move to dotenv + custom env validations

ref #18
This commit is contained in:
2020-12-09 19:40:08 +01:00
parent 4cfe9df429
commit 622bdf7a3f
4 changed files with 28 additions and 9 deletions

View File

@@ -2,7 +2,7 @@ import consola from "consola";
import "reflect-metadata";
import { createExpressServer } from "routing-controllers";
import authchecker from "./authchecker";
import { config } from './config';
import { config, e as errors } from './config';
import loaders from "./loaders/index";
import { ErrorHandler } from './middlewares/ErrorHandler';
@@ -23,4 +23,9 @@ async function main() {
);
});
}
main();
if (errors === 0) {
main();
} else {
console.log("error");
// something's wrong
}