mirror of
https://codeberg.org/aryak/mozhi
synced 2025-01-05 15:31:58 +05:30
add cors header for API endpoints (closes #55)
This commit is contained in:
parent
099885f315
commit
8d3855589f
@ -95,6 +95,11 @@ func Serve(port string) {
|
||||
})
|
||||
|
||||
api := app.Group("/api")
|
||||
// Set CORS Header for all API endpoints
|
||||
api.Use(func(c *fiber.Ctx) error {
|
||||
c.Set("Access-Control-Allow-Origin", "*")
|
||||
return c.Next()
|
||||
})
|
||||
api.All("/translate", pages.HandleTranslate)
|
||||
api.All("/image", pages.HandleImg)
|
||||
api.Get("/source_languages", pages.HandleSourceLanguages)
|
||||
|
Loading…
Reference in New Issue
Block a user