mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-16 08:54:58 +02:00
don't inject db into req
This commit is contained in:
parent
06ee87ac2c
commit
497b8a223f
4 changed files with 11 additions and 30 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue