34 lines
952 B
JavaScript
34 lines
952 B
JavaScript
const appInfo = require("./package.json");
|
|
const appVersion = appInfo.version ?? "0.0.0";
|
|
const appDate = new Date();
|
|
|
|
const dev = {
|
|
NODE_ENV: "development",
|
|
APP_VERSION: appVersion,
|
|
APP_DATE: appDate,
|
|
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",
|
|
APP_VERSION: appVersion,
|
|
APP_DATE: appDate,
|
|
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;
|