Add CORS support and Docker configuration for web service
Publish telemt-api gateway Docker image / test (push) Successful in 24s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 1m18s

- Added CORS allowed origins in config.compose.yaml to enable cross-origin requests from the web service.
- Updated docker-compose.yml to include a new web service with build context and port mapping for local development.
- Enhanced gateway.go to support additional HTTP methods in CORS responses.
- Updated README.md to document the new web service and its configuration requirements.
This commit is contained in:
Denozordec
2026-03-30 10:31:10 +07:00
parent 04c257a84e
commit ef98560e9f
167 changed files with 8645 additions and 1 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ func (g *Gateway) withCORS(next http.Handler) http.Handler {
ok, allowOrigin := corsMatch(g.corsAllowed, origin)
if ok {
w.Header().Set("Access-Control-Allow-Origin", allowOrigin)
w.Header().Set("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS")
w.Header().Set("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type, X-Request-Id")
w.Header().Set("Access-Control-Max-Age", "86400")
}