reverse-proxy-frontend/config.js

26 lines
737 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",
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",
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;