add place name

This commit is contained in:
2025-05-18 19:26:16 +07:00
parent 73838d7773
commit 107504317e
14 changed files with 164 additions and 131 deletions
+13 -1
View File
@@ -77,7 +77,7 @@ func main() {
gwServer := &http.Server{
Addr: ":8090",
Handler: gwmux,
Handler: cors(gwmux),
}
// Serve gRPC-Gateway server
@@ -104,3 +104,15 @@ func main() {
log.Println("Serving admin web on http://0.0.0.0:8110")
log.Fatalln(http.ListenAndServe(":8110", muxAdmin))
}
func cors(h 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-Methods", "GET, POST, PATCH, DELETE")
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, Authorization, ResponseType, X-Id, X-Password")
if r.Method == "OPTIONS" {
return
}
h.ServeHTTP(w, r)
})
}