mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): move constant into common package (#522)
* refactor(server): move constant into common package * refactor(server): re-arrange import statement in microservice module * refactor(server): move app.config into common package * fix(server): e2e testing
This commit is contained in:
parent
0efcc99f3e
commit
3b55cdc0be
18 changed files with 72 additions and 40 deletions
20
server/libs/common/src/config/app.config.ts
Normal file
20
server/libs/common/src/config/app.config.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { ConfigModuleOptions } from '@nestjs/config';
|
||||
import Joi from 'joi';
|
||||
|
||||
export const immichAppConfig: ConfigModuleOptions = {
|
||||
envFilePath: '.env',
|
||||
isGlobal: true,
|
||||
validationSchema: Joi.object({
|
||||
NODE_ENV: Joi.string().required().valid('development', 'production', 'staging').default('development'),
|
||||
DB_USERNAME: Joi.string().required(),
|
||||
DB_PASSWORD: Joi.string().required(),
|
||||
DB_DATABASE_NAME: Joi.string().required(),
|
||||
JWT_SECRET: Joi.string().required(),
|
||||
ENABLE_MAPBOX: Joi.boolean().required().valid(true, false),
|
||||
MAPBOX_KEY: Joi.any().when('ENABLE_MAPBOX', {
|
||||
is: false,
|
||||
then: Joi.string().optional().allow(null, ''),
|
||||
otherwise: Joi.string().required(),
|
||||
}),
|
||||
}),
|
||||
};
|
||||
1
server/libs/common/src/config/index.ts
Normal file
1
server/libs/common/src/config/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './app.config';
|
||||
1
server/libs/common/src/constants/index.ts
Normal file
1
server/libs/common/src/constants/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './upload_location.constant';
|
||||
|
|
@ -0,0 +1 @@
|
|||
export const APP_UPLOAD_LOCATION = './upload';
|
||||
2
server/libs/common/src/index.ts
Normal file
2
server/libs/common/src/index.ts
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export * from './config';
|
||||
export * from './constants';
|
||||
9
server/libs/common/tsconfig.lib.json
Normal file
9
server/libs/common/tsconfig.lib.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"outDir": "../../dist/libs/common"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue