feat: init project and add user module
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import { registerAs } from '@nestjs/config';
|
||||
|
||||
export default registerAs('app', () => ({
|
||||
environment: process.env.NODE_ENV || 'production',
|
||||
}));
|
||||
@@ -0,0 +1,11 @@
|
||||
import { registerAs } from '@nestjs/config';
|
||||
|
||||
export default registerAs('database', () => ({
|
||||
host: process.env.DATABASE_HOST || 'localhost',
|
||||
port: parseInt(process.env.DATABASE_PORT || '5432'),
|
||||
user: process.env.DATABASE_USER,
|
||||
password: process.env.DATABASE_PASS,
|
||||
name: process.env.DATABASE_NAME,
|
||||
autoLoad: process.env.DATABASE_AUTOLOAD === 'true' ? true : false,
|
||||
synchronize: process.env.DATABASE_SYNC === 'true' ? true : false,
|
||||
}));
|
||||
@@ -0,0 +1,14 @@
|
||||
import Joi from 'joi';
|
||||
|
||||
export default Joi.object({
|
||||
NODE_ENV: Joi.string()
|
||||
.valid('development', 'test', 'production', 'staging')
|
||||
.default('development'),
|
||||
DATABASE_HOST: Joi.string().required(),
|
||||
DATABASE_PORT: Joi.number().port().default(5432),
|
||||
DATABASE_USER: Joi.string().required(),
|
||||
DATABASE_PASS: Joi.string().required(),
|
||||
DATABASE_NAME: Joi.string().required(),
|
||||
DATABASE_AUTOLOAD: Joi.boolean().default('true'),
|
||||
DATABASE_SYNC: Joi.boolean().default('true'),
|
||||
});
|
||||
Reference in New Issue
Block a user