reverse-proxy-frontend/config.js

30 lines
837 B
JavaScript
Raw Normal View History

2021-09-07 09:42:48 +03:00
const dev = {
2022-07-16 14:02:14 +03:00
NODE_ENV: "development",
2022-09-24 02:57:49 +03:00
APP_VERSION: "0.0.0",
APP_DATE: "1900-01-01",
REVERSE_PROXY_API_URL: "http://localhost:5050",
2021-09-07 09:42:48 +03:00
CHATBOT_API_URL: "http://localhost:5061",
2022-07-15 10:01:26 +03:00
REVERSE_PROXY_DOCS_URL: "https://toodle.ddns.net/hedgedoc/s/UkJ6S5NJz"
2021-09-07 09:42:48 +03:00
};
2021-09-07 19:21:25 +03:00
const prod = {
NODE_ENV: "production",
2022-09-24 02:57:49 +03:00
APP_VERSION: "0.0.0",
APP_DATE: "1900-01-01",
2021-09-07 19:21:25 +03:00
PUBLIC_URL: "/reverse-proxy",
REVERSE_PROXY_API_URL: "https://toodle.ddns.net/reverse-proxy-api",
CHATBOT_API_URL: "https://toodle.ddns.net/chatbot-api",
2022-07-15 10:01:26 +03:00
REVERSE_PROXY_DOCS_URL: "https://toodle.ddns.net/hedgedoc/s/UkJ6S5NJz"
2021-09-07 19:21:25 +03:00
};
2022-07-16 14:02:14 +03:00
const getConfig = env => {
const config = env === "prod" ? prod : dev;
let configs = {};
Object.keys(config).forEach(z => {
configs[`process.env.${z}`] = JSON.stringify(config[z]);
});
return configs;
};
module.exports = getConfig;