From 53b246a6df4a0b56f98e64b40bb5138c40117734 Mon Sep 17 00:00:00 2001 From: 123niel Date: Thu, 7 Feb 2019 12:13:32 +0100 Subject: [PATCH 1/3] added Cors-Header --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 0d28d9f..1480e3f 100644 --- a/main.go +++ b/main.go @@ -16,16 +16,23 @@ import ( "git.cliffbreak.de/Cliffbreak/tsviewer/service" "github.com/go-chi/chi" "github.com/go-chi/chi/middleware" + "github.com/go-chi/cors" ) func Routes(s service.Service, t template.Template) *chi.Mux { router := chi.NewRouter() + cors := cors.New(cors.Options{ + AllowedOrigins: []string{"*"}, + AllowedMethods: []string{"Get"}, + }) router.Use( middleware.Logger, middleware.Timeout(5*time.Second), middleware.DefaultCompress, middleware.RedirectSlashes, middleware.Recoverer, + + cors.Handler, ) router.Route("/v1", func(r chi.Router) { -- 2.45.2 From bfba32968c5a3de51b59b290c1a1399dbc97ba78 Mon Sep 17 00:00:00 2001 From: 123niel Date: Thu, 7 Feb 2019 14:50:36 +0100 Subject: [PATCH 2/3] updated readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index be7b983..e1d6f24 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ I´m a sick Fuck i like the sick F09ck ```bash docker build -t name/cont:ver . -docker run -e TS3_IP="0.0.0.0", TS3_PW="f3gWdOU3", WEB_PORT="8080" -d -p 8080:8080 name/cont:ver +docker run -e TS3_IP="0.0.0.0" -e TS3_PW="f3gWdOU3" -e WEB_PORT="8080" -d -p 8080:8080 name/cont:ver ``` ENV: ```Docker @@ -49,10 +49,10 @@ The config file is generated automatically on first startup. ## URL-Parameter -| Name | Type | Description | -| ---------- | -------- | ------------------------ | -| `pretty` | `bool` | pretty-prints JSON | -| `envelope` | `bool` | wraps JSON in data array | +| Name | Type | Description | +| ---------- | ------ | ------------------------ | +| `pretty` | `bool` | pretty-prints JSON | +| `envelope` | `bool` | wraps JSON in data array | ## Channels -- 2.45.2 From b91c02e8151fcb56e1ce946f464d08a6c94de545 Mon Sep 17 00:00:00 2001 From: 123niel Date: Thu, 7 Feb 2019 14:58:44 +0100 Subject: [PATCH 3/3] annonymized readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1d6f24..618bbb1 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ I´m a sick Fuck i like the sick F09ck ```bash docker build -t name/cont:ver . -docker run -e TS3_IP="0.0.0.0" -e TS3_PW="f3gWdOU3" -e WEB_PORT="8080" -d -p 8080:8080 name/cont:ver +docker run -e TS3_IP="" -e TS3_PW="" -e WEB_PORT="8080" -d -p 8080:8080 name/cont:ver ``` ENV: ```Docker -- 2.45.2