From 2cdd1cd96196f586abfa50ba2f2b05f99545c669 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 20 Dec 2020 18:07:58 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20move=20to=20new=20config=20based?= =?UTF-8?q?=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- index.html | 3 ++- nginx.conf | 11 ++++------- public/env.sample.js | 6 ++++++ src/components/Login.svelte | 13 ++++++------- 5 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 public/env.sample.js diff --git a/.gitignore b/.gitignore index 49ce2306..d9ccf3ab 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ node_modules dist dist-ssr - +public/env.js \ No newline at end of file diff --git a/index.html b/index.html index 1f7aedf1..3dd0d0cc 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,7 @@ - + + diff --git a/nginx.conf b/nginx.conf index 5c98573b..0f0bce3b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,12 +1,9 @@ -# http { +events{} +http { include mime.types; - # sendfile on; + sendfile on; server { root /usr/share/nginx/html; - location / { - add_header "Set-Cookie" '${APP_CONF}'; - } - location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { expires 1y; add_header Pragma public; @@ -27,4 +24,4 @@ gzip_http_version 1.1; gzip_types application/javascript application/rss+xml application/vnd.ms-fontobject application/x-font application/x-font-opentype application/x-font-otf application/x-font-truetype application/x-font-ttf application/x-javascript application/xhtml+xml application/xml font/opentype font/otf font/ttf image/svg+xml image/x-icon text/css text/javascript text/plain text/xml; } -# } \ No newline at end of file +} \ No newline at end of file diff --git a/public/env.sample.js b/public/env.sample.js new file mode 100644 index 00000000..f5031633 --- /dev/null +++ b/public/env.sample.js @@ -0,0 +1,6 @@ +const config = { + baseurl: 'http://localhost:4010', + // optional params ⏬ + fallback_username: 'demo', + fallback_password: 'demo' +}; diff --git a/src/components/Login.svelte b/src/components/Login.svelte index 20212c87..c3992749 100644 --- a/src/components/Login.svelte +++ b/src/components/Login.svelte @@ -1,7 +1,6 @@