tsk-4: Adding CORS support (#53)
Closes #4 Reviewed-on: phoenix/textsender-api#53 Co-authored-by: phoenix <kundeng00@pm.me> Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
+1
-1
@@ -95,7 +95,7 @@ func main() {
|
||||
|
||||
// Configure CORS
|
||||
router.Use(cors.Handler(cors.Options{
|
||||
AllowedOrigins: []string{fmt.Sprintf("http://localhost:%s", config.PORT), "http://localhost:5173", "https://textsender.com"},
|
||||
AllowedOrigins: cfg.AllowedOrigins,
|
||||
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"},
|
||||
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token"},
|
||||
ExposedHeaders: []string{"Link", "X-Total-Count"},
|
||||
|
||||
Reference in New Issue
Block a user