mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-03 20:12:59 +00:00
Add files via upload
This commit is contained in:
@@ -120,7 +120,7 @@ monitor: ## Monitor the service with file watching
|
||||
@while true; do \
|
||||
inotifywait -e modify contacts.xlsx 2>/dev/null && \
|
||||
echo "File changed, reloading..." && \
|
||||
curl -X POST http://localhost:$(PORT)/kontakt/reload; \
|
||||
curl -X POST http://webportal:$(PORT)/kontakt/reload; \
|
||||
sleep 1; \
|
||||
done
|
||||
|
||||
@@ -163,6 +163,6 @@ info: ## Show application information
|
||||
@echo "Build dir: $(BUILD_DIR)"
|
||||
@echo ""
|
||||
@echo "Endpoints:"
|
||||
@echo " http://localhost:$(PORT)/kontakt - Web interface"
|
||||
@echo " http://localhost:$(PORT)/kontakt/contacts - JSON API"
|
||||
@echo " http://localhost:$(PORT)/kontakt/reload - Reload data (POST)"
|
||||
@echo " http://webportal:$(PORT)/kontakt - Web interface"
|
||||
@echo " http://webportal:$(PORT)/kontakt/contacts - JSON API"
|
||||
@echo " http://webportal:$(PORT)/kontakt/reload - Reload data (POST)"
|
||||
+1
-1
@@ -39,7 +39,7 @@
|
||||
<nav class="bg-brand-blue text-white shadow-lg">
|
||||
<div class="max-w-6xl mx-auto px-4 py-3 flex justify-between items-center">
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="../index.html"><img src="http://pp-kunovice.cz/wp-content/uploads/2022/04/logo-retina-white.png" alt="Poppe Potthoff Logo" class="h-10"></a>
|
||||
<a href="webportal"><img src="http://pp-kunovice.cz/wp-content/uploads/2022/04/logo-retina-white.png" alt="Poppe Potthoff Logo" class="h-10"></a>
|
||||
<div class="hidden md:block text-xl font-semibold">Poppe + Potthoff</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user