reverse-proxy-frontend/config.js

26 lines
737 B
JavaScript

const dev = {
NODE_ENV: "development",
REVERSE_PROXY_API_URL: "http://localhost:5050",
CHATBOT_API_URL: "http://localhost:5061",
REVERSE_PROXY_DOCS_URL: "https://toodle.ddns.net/hedgedoc/s/UkJ6S5NJz"
};
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",
REVERSE_PROXY_DOCS_URL: "https://toodle.ddns.net/hedgedoc/s/UkJ6S5NJz"
};
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;