From 908977b5ee7b5b2ce32da1486b428d02c648d452 Mon Sep 17 00:00:00 2001 From: Graham Land Date: Wed, 26 Sep 2018 00:14:23 +0100 Subject: [PATCH] added allow methods --- main.go | 1 + scripts/install_webserver.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 38d5f70..3ce9922 100644 --- a/main.go +++ b/main.go @@ -84,6 +84,7 @@ func main() { func enableCors(w *http.ResponseWriter) { (*w).Header().Set("Access-Control-Allow-Origin", "*") + (*w).Header().Set("Access-Control-Allow-Methods", "GET, POST, OPTIONS, PUT, PATCH, DELETE") (*w).Header().Set("PageCountIP", targetIP) (*w).Header().Set("PageCountServer", thisServer) (*w).Header().Set("PageCountPort", targetPort) diff --git a/scripts/install_webserver.sh b/scripts/install_webserver.sh index 519c8e8..6d6172f 100755 --- a/scripts/install_webserver.sh +++ b/scripts/install_webserver.sh @@ -67,7 +67,7 @@ EOF echo 'Register nginx service with Consul Service Discovery Complete' } -sudo mv /usr/local/bootstrap/webclient/wpc-fe /var/www/wpc-fe +sudo cp /usr/local/bootstrap/webclient/wpc-fe /var/www/wpc-fe sudo cp /usr/local/bootstrap/conf/wpc-fe.conf /etc/nginx/conf.d/wpc-fe.conf # remove nginx default website