api: remove alias mapping for deprecated env variables
This commit is contained in:
parent
edbea16b91
commit
e58bca0cdd
3 changed files with 0 additions and 25 deletions
|
@ -1,5 +1,4 @@
|
||||||
import "dotenv/config";
|
import "dotenv/config";
|
||||||
import "./misc/alias-envs.js";
|
|
||||||
|
|
||||||
import express from "express";
|
import express from "express";
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
import { Red } from "./console-text.js";
|
|
||||||
|
|
||||||
const mapping = {
|
|
||||||
apiPort: 'API_PORT',
|
|
||||||
apiURL: 'API_URL',
|
|
||||||
apiName: 'API_NAME',
|
|
||||||
cors: 'CORS_WILDCARD',
|
|
||||||
cookiePath: 'COOKIE_PATH',
|
|
||||||
webPort: 'WEB_PORT',
|
|
||||||
webURL: 'WEB_URL',
|
|
||||||
showSponsors: 'SHOW_SPONSORS',
|
|
||||||
isBeta: 'IS_BETA'
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const [ oldEnv, newEnv ] of Object.entries(mapping)) {
|
|
||||||
if (process.env[oldEnv] && !process.env[newEnv]) {
|
|
||||||
process.env[newEnv] = process.env[oldEnv];
|
|
||||||
console.error(`${Red('[!]')} ${oldEnv} is deprecated and will be removed in a future version.`);
|
|
||||||
console.error(` You should use ${newEnv} instead.`);
|
|
||||||
console.error();
|
|
||||||
delete process.env[oldEnv];
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,4 @@
|
||||||
import "dotenv/config";
|
import "dotenv/config";
|
||||||
import "../misc/alias-envs.js";
|
|
||||||
|
|
||||||
import { services } from "../processing/service-config.js";
|
import { services } from "../processing/service-config.js";
|
||||||
import { extract } from "../processing/url.js";
|
import { extract } from "../processing/url.js";
|
||||||
|
|
Loading…
Reference in a new issue