Add files via upload

This commit is contained in:
Tomáš Dvořák
2025-05-23 12:23:52 +02:00
committed by GitHub
parent 0a80a51104
commit 01c157331e
3 changed files with 9 additions and 9 deletions
+4 -4
View File
@@ -40,7 +40,7 @@ func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
// Set up reverse proxy to kontakt service
kontaktURL, _ := url.Parse("http://localhost:8080")
kontaktURL, _ := url.Parse("http://webportal:8080")
kontaktProxy := httputil.NewSingleHostReverseProxy(kontaktURL)
http.Handle("/kontakt/", http.StripPrefix("/kontakt", kontaktProxy))
@@ -61,9 +61,9 @@ func main() {
http.HandleFunc("/kontakt", enableCORS(func(w http.ResponseWriter, r *http.Request) {
// Check if kontakt service is already running
resp, err := http.Get("http://localhost:8080/health")
resp, err := http.Get("http://webportal:8080/health")
if err == nil && resp.StatusCode == 200 {
http.Redirect(w, r, "http://localhost:8080/", http.StatusFound)
http.Redirect(w, r, "http://webportal:8080/", http.StatusFound)
return
}
@@ -78,7 +78,7 @@ func main() {
// Wait briefly for service to start
time.Sleep(2 * time.Second)
http.Redirect(w, r, "http://localhost:8080/", http.StatusFound)
http.Redirect(w, r, "http://webportal:8080/", http.StatusFound)
}))
port := os.Getenv("PORT")