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 + '/', }, }, },