From 9c776542d563799cced2bbd4f36a22c8e6d65519 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 15 Jun 2021 15:54:44 +0300 Subject: [PATCH] config envs --- src/config.js | 8 +++++++- src/config/production.json | 4 ++++ src/{config.json => config/test.json} | 0 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/config/production.json rename src/{config.json => config/test.json} (100%) diff --git a/src/config.js b/src/config.js index b0581c3..920f341 100644 --- a/src/config.js +++ b/src/config.js @@ -1,4 +1,10 @@ -import config from "@/config.json"; +let config; + +if ("production" == process.env.NODE_EN) { + config = require("@/config/production.json"); +} else { + config = require("@/config/test.json"); +} export default { ...config, diff --git a/src/config/production.json b/src/config/production.json new file mode 100644 index 0000000..8523792 --- /dev/null +++ b/src/config/production.json @@ -0,0 +1,4 @@ +{ + "api": "/api/v1", + "url_prefix": "" +} diff --git a/src/config.json b/src/config/test.json similarity index 100% rename from src/config.json rename to src/config/test.json