don't inject db into req

This commit is contained in:
Milo Schwartz 2024-09-28 13:40:24 -04:00
parent 06ee87ac2c
commit 497b8a223f
No known key found for this signature in database
4 changed files with 11 additions and 30 deletions

View file

@ -18,14 +18,14 @@ const environment = {
PORT: (process.env.PORT as string) || "3000",
INTERNAL_PORT: (process.env.INTERNAL_PORT as string) || "3001",
CONFIG_PATH: process.env.CONFIG_PATH as string,
API_VERSION: process.env.API_VERSION as string,
API_VERSION: (process.env.API_VERSION as string) || "v1",
};
const parsedConfig = environmentSchema.safeParse(environment);
if (!parsedConfig.success) {
const errors = fromError(parsedConfig.error);
throw new Error(`Invalid environment configuration: ${errors}`);
const errors = fromError(parsedConfig.error);
throw new Error(`Invalid environment configuration: ${errors}`);
}
export default parsedConfig.data;