Skip to content

Commit

Permalink
update preflightHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyangXYZ committed Nov 16, 2021
1 parent 35863e0 commit 09a6a37
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sgo.go
Expand Up @@ -10,6 +10,9 @@ import (
// HandlerFunc context handler func
type HandlerFunc func(*Context) error

// PreflightHandler is a dummy handler that handles preflight request when CORS
var PreflightHandler = func(ctx *Context) error { return ctx.Text(200, "") }

// SGo is Suuuuuuuuper Sweetie!
type SGo struct {
// Router is based on a radix/trie tree.
Expand All @@ -25,9 +28,6 @@ type SGo struct {
Templates *Templates

Middlewares []HandlerFunc

// PreflightHandler is a dummy handler that handles preflight request when CORS
PreflightHandler func(ctx *Context) error
}

// New SGo App.
Expand All @@ -46,7 +46,6 @@ func New() *SGo {
return NewContext(nil, nil, sg)
},
}
sg.PreflightHandler = func(ctx *Context) error { return ctx.Text(200, "") }
return sg
}

Expand Down

0 comments on commit 09a6a37

Please sign in to comment.