Add PostGIS compose service and update public integration docs.
CI / test (push) Successful in 5s

Wire API services to PostGIS in docker-compose, broaden CORS handling for cross-origin clients, and align developer docs with the production momswap URL.

Made-with: Cursor
This commit is contained in:
2026-03-01 12:08:47 +00:00
parent f51126419c
commit a2aae391ad
4 changed files with 57 additions and 5 deletions
+9 -2
View File
@@ -45,8 +45,15 @@ func (a *API) Routes() http.Handler {
func withCORS(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type")
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PATCH, DELETE, OPTIONS")
w.Header().Set("Vary", "Origin, Access-Control-Request-Method, Access-Control-Request-Headers")
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD")
w.Header().Set("Access-Control-Max-Age", "86400")
requestHeaders := r.Header.Get("Access-Control-Request-Headers")
if requestHeaders != "" {
w.Header().Set("Access-Control-Allow-Headers", requestHeaders)
} else {
w.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type, Accept, Origin, X-Requested-With")
}
if r.Method == http.MethodOptions {
w.WriteHeader(http.StatusNoContent)
return