mirror of
https://github.com/movie-web/backend.git
synced 2025-09-13 14:53:25 +00:00
Add ORM Specific config
This commit is contained in:
20
src/config/orm.ts
Normal file
20
src/config/orm.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { createConfigLoader } from 'neat-config';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const ormConfigSchema = z.object({
|
||||
postgres: z.object({
|
||||
// connection URL for postgres database
|
||||
connection: z.string(),
|
||||
}),
|
||||
});
|
||||
|
||||
export const ormConf = createConfigLoader()
|
||||
.addFromEnvironment('MWB_')
|
||||
.addFromCLI('mwb-')
|
||||
.addFromFile('.env', {
|
||||
prefix: 'MWB_',
|
||||
})
|
||||
.addFromFile('config.json')
|
||||
.addZodSchema(ormConfigSchema)
|
||||
.freeze()
|
||||
.load();
|
Reference in New Issue
Block a user