mirror of
https://github.com/maputnik/editor.git
synced 2026-06-22 07:07:26 +00:00
Support CORS
This commit is contained in:
+2
-1
@@ -53,9 +53,10 @@ func main() {
|
|||||||
|
|
||||||
router.PathPrefix("/").Handler(http.StripPrefix("/", gui))
|
router.PathPrefix("/").Handler(http.StripPrefix("/", gui))
|
||||||
loggedRouter := handlers.LoggingHandler(os.Stdout, router)
|
loggedRouter := handlers.LoggingHandler(os.Stdout, router)
|
||||||
|
corsRouter := handlers.CORS(handlers.AllowedHeaders([]string{"Content-Type"}), handlers.AllowedMethods([]string{"GET", "PUT"}), handlers.AllowedOrigins([]string{"*"}), handlers.AllowCredentials())(loggedRouter)
|
||||||
|
|
||||||
fmt.Println("Exposing Maputnik on http://localhost:8000")
|
fmt.Println("Exposing Maputnik on http://localhost:8000")
|
||||||
return http.ListenAndServe(":8000", loggedRouter)
|
return http.ListenAndServe(":8000", corsRouter)
|
||||||
}
|
}
|
||||||
|
|
||||||
app.Run(os.Args)
|
app.Run(os.Args)
|
||||||
|
|||||||
Reference in New Issue
Block a user