From c22cf6ffceff1b524ff48b1447058769f121acce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Wed, 27 Jan 2021 14:57:16 +0100 Subject: [PATCH] move proxy settings to env. --- .env | 3 +++ .gitignore | 1 + vue.config.js | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 00000000..6f7c7e0f --- /dev/null +++ b/.env @@ -0,0 +1,3 @@ +# proxy for neko server +NEKO_HOST="192.168.1.20" +NEKO_PORT="3000" diff --git a/.gitignore b/.gitignore index f06235c4..f9db0a6f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +.env.local node_modules dist diff --git a/vue.config.js b/vue.config.js index a8563343..2277bd69 100644 --- a/vue.config.js +++ b/vue.config.js @@ -14,11 +14,11 @@ module.exports = { disableHostCheck: true, proxy: { '^/ws': { - target: 'ws://192.168.1.20:3000/', + target: 'ws://' + process.env.NEKO_HOST + ':' + process.env.NEKO_PORT + '/', ws: true, }, '^/api': { - target: 'http://192.168.1.20:3000/', + target: 'http://' + process.env.NEKO_HOST + ':' + process.env.NEKO_PORT + '/', }, }, },