Added CORS-header sent
the build was successful Details

This commit is contained in:
konrad 2017-11-10 16:29:45 +01:00 committed by kolaente
parent 3adad3b4c0
commit e70a414b44
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 0 deletions

View File

@ -76,16 +76,22 @@ func RegisterRoutes(e *echo.Echo) {
// Manage Books
a.PUT("/books", apiv1.BookAdd)
a.DELETE("/books/:id", apiv1.BookDelete)
a.OPTIONS("/books", SetCORSHeader)
a.OPTIONS("/books/:id", SetCORSHeader)
// Manage Authors
a.PUT("/authors", apiv1.AuthorAdd)
a.DELETE("/authors/:id", apiv1.AuthorDelete)
a.POST("/authors/:id", apiv1.AuthorUpdate)
a.OPTIONS("/authors", SetCORSHeader)
a.OPTIONS("/authors/:id", SetCORSHeader)
// Manage Publishers
a.PUT("/publishers", apiv1.PublisherAdd)
a.DELETE("/publishers/:id", apiv1.PublisherDelete)
a.POST("/publishers/:id", apiv1.PublisherUpdate)
a.OPTIONS("/publishers", SetCORSHeader)
a.OPTIONS("/publishers/:id", SetCORSHeader)
// Manage Users