Skip to content

Commit a3eff63

Browse files
committed
allow all origins
1 parent 9a689e9 commit a3eff63

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

app/transports/api/api.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,20 @@ func Build() fx.Option {
4545
fx.Provide(func(as *authentication.State, l *zap.Logger, cfg config.Config) chi.Router {
4646
router := chi.NewRouter()
4747

48-
origins := []string{
49-
"http://localhost:3000", // Local development, `npm run dev`
50-
cfg.LauncherBackendAddress, // Launcher backend address
51-
cfg.PublicWebAddress, // Live public website
52-
}
48+
// Just use *, people actually use our api publicly
49+
// origins := []string{
50+
// "http://localhost:3000", // Local development, `npm run dev`
51+
// cfg.LauncherBackendAddress, // Launcher backend address
52+
// cfg.PublicWebAddress, // Live public website
53+
// }
5354

54-
l.Debug("preparing router", zap.Strings("origins", origins))
55+
// l.Debug("preparing router", zap.Strings("origins", origins))
5556

5657
router.Use(
5758
web.WithLogger,
5859
web.WithContentType,
5960
cors.Handler(cors.Options{
60-
AllowedOrigins: origins,
61+
AllowedOrigins: []string{"*"},
6162
AllowedMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"},
6263
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "Content-Length", "X-CSRF-Token"},
6364
ExposedHeaders: []string{"Link", "Content-Length", "X-Ratelimit-Limit", "X-Ratelimit-Reset"},

0 commit comments

Comments
 (0)