mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Added CORS support to API.
This commit is contained in:
parent
e44b4b2540
commit
adbebd4de8
2 changed files with 14 additions and 0 deletions
|
@ -18,8 +18,10 @@ func Serve(router *mux.Router, store *storage.Storage, pool *worker.Pool, feedHa
|
|||
|
||||
sr := router.PathPrefix("/v1").Subrouter()
|
||||
middleware := newMiddleware(store)
|
||||
sr.Use(middleware.handleCORS)
|
||||
sr.Use(middleware.apiKeyAuth)
|
||||
sr.Use(middleware.basicAuth)
|
||||
sr.Methods("OPTIONS")
|
||||
sr.HandleFunc("/users", handler.createUser).Methods("POST")
|
||||
sr.HandleFunc("/users", handler.users).Methods("GET")
|
||||
sr.HandleFunc("/users/{userID:[0-9]+}", handler.userByID).Methods("GET")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue