fix: Removed DB_URL reference

This commit is contained in:
Cyper committed 2026-04-17 00:35:22 -04:00
1 parent 6ed816ed95
commit 3752708d97
4 files changed
+9 -27

No files matched your search

-3
View File
@@ -9,9 +9,6 @@ DB_PORT=3306
DB_NAME=
DB_USER=
DB_PASS=
# This field is optional - if not supplied, it will be built from the above fields.
# If you need the string to be a specific format, you may override it with this field.
DB_URL=
# Security settings
SESSION_SECRET=
+4
View File
@@ -0,0 +1,4 @@
{
"plugins": ["prettier-plugin-tailwindcss"],
"singleQuote": true
}
-6
View File
@@ -82,12 +82,6 @@ DB_PASS=<PASSWORD>
SESSION_SECRET=a2VwdG9mZmljaWFsYXJyYW5nZW1lbnRpbmRlcGVuZGVudGxha2VjbGVhcmx5b2xkZXJibG9vZHRpcHNwZWVjaA==
```
If for whatever reason you need to override the default format of
`mysql://user:password@host:port/name` for your database connection string, you my
optionally include a `DB_URL=...` value in the config to override how the connection
string is generated, which will ignore all other `DB_*` values and use your exact
inputted value.
## Running Application
Once the `.env` file has been configured, you may now run the application. This application
+5 -18
View File
@@ -53,33 +53,20 @@ type Environment = {
DB_USER: string;
DB_PASS: string;
DB_NAME: string;
DB_URL: string;
SESSION_SECRET: string;
PASSWORD_PEPPER: string;
};
const DB_HOST = tryParseString(process.env.DB_HOST, '');
const DB_PORT = tryParseInt(process.env.DB_PORT, 3306);
const DB_USER = tryParseString(process.env.DB_USER, '');
const DB_PASS = tryParseString(process.env.DB_PASS, '');
const DB_NAME = tryParseString(process.env.DB_NAME, '');
const DB_URL = tryParseString(process.env.DB_URL, '');
export default {
APP_PORT: tryParseInt(process.env.APP_PORT, 80),
APP_ENVIRONMENT: tryParseString(process.env.APP_ENVIRONMENT, 'prod'),
DB_HOST,
DB_PORT,
DB_USER,
DB_PASS,
DB_NAME,
// Build DB URL string if none supplied, otherwise use config-specified value
DB_URL:
DB_URL === ''
? `mysql://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}`
: DB_URL,
DB_HOST: tryParseString(process.env.DB_HOST, ''),
DB_PORT: tryParseInt(process.env.DB_PORT, 3306),
DB_USER: tryParseString(process.env.DB_USER, ''),
DB_PASS: tryParseString(process.env.DB_PASS, ''),
DB_NAME: tryParseString(process.env.DB_NAME, ''),
SESSION_SECRET: tryParseString(process.env.SESSION_SECRET, ''),
PASSWORD_PEPPER: tryParseString(process.env.PASSWORD_PEPPER, ''),