gofmt
This commit is contained in:
parent
dc7db298bd
commit
89ae122fc3
9 changed files with 113 additions and 114 deletions
|
|
@ -1,9 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"github.com/gorilla/mux"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func NewRouter() *mux.Router {
|
||||
|
|
@ -13,21 +13,21 @@ func NewRouter() *mux.Router {
|
|||
handler = Logger(route.Handler, route.Name)
|
||||
|
||||
router.
|
||||
Methods(route.Method).
|
||||
Path(route.Pattern).
|
||||
Name(route.Name).
|
||||
Handler(handler)
|
||||
Methods(route.Method).
|
||||
Path(route.Pattern).
|
||||
Name(route.Name).
|
||||
Handler(handler)
|
||||
|
||||
router.
|
||||
Methods("OPTIONS").
|
||||
Name("Options Handler").
|
||||
Handler(http.HandlerFunc(optionsHandler))
|
||||
Methods("OPTIONS").
|
||||
Name("Options Handler").
|
||||
Handler(http.HandlerFunc(optionsHandler))
|
||||
}
|
||||
|
||||
router.
|
||||
Methods("OPTIONS").
|
||||
Name("Options Handler").
|
||||
Handler(http.HandlerFunc(optionsHandler))
|
||||
Methods("OPTIONS").
|
||||
Name("Options Handler").
|
||||
Handler(http.HandlerFunc(optionsHandler))
|
||||
|
||||
router.NotFoundHandler = http.HandlerFunc(notFound)
|
||||
|
||||
|
|
@ -48,4 +48,4 @@ func optionsHandler(w http.ResponseWriter, r *http.Request) {
|
|||
w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
|
||||
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, PUT, DELETE")
|
||||
w.WriteHeader(200)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue