refactor(config): improve consola error logs
This commit is contained in:
parent
2ab6e985e3
commit
ce9b765b81
@ -1,3 +1,4 @@
|
||||
import consola from 'consola';
|
||||
import { config as configDotenv } from 'dotenv';
|
||||
import { CountryCode } from 'libphonenumber-js';
|
||||
import ValidatorJS from 'validator';
|
||||
@ -20,12 +21,15 @@ export const config = {
|
||||
}
|
||||
let errors = 0
|
||||
if (typeof config.internal_port !== "number") {
|
||||
consola.error("Error: APP_PORT is not a number")
|
||||
errors++
|
||||
}
|
||||
if (typeof config.development !== "boolean") {
|
||||
consola.error("Error: NODE_ENV is not a boolean")
|
||||
errors++
|
||||
}
|
||||
if (config.mailer_url == "" || config.mailer_key == "") {
|
||||
consola.error("Error: invalid mailer config")
|
||||
errors++;
|
||||
}
|
||||
function getPhoneCodeLocale(): CountryCode {
|
||||
|
Loading…
x
Reference in New Issue
Block a user