generated from 0xb4lamx/nestjs-boilerplate-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathormconfig.js
28 lines (24 loc) · 763 Bytes
/
ormconfig.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import * as dotenv from 'dotenv';
import { SnakeNamingStrategy } from './src/shared/typeorm/strategies/snake-naming.strategy';
dotenv.config({
path: `.env`,
});
// Replace \\n with \n to support multiline strings in AWS
for (const envName of Object.keys(process.env)) {
process.env[envName] = process.env[envName].replace(/\\n/g, '\n');
}
module.exports = {
type: 'mysql',
host: process.env.MYSQL_HOST,
port: +process.env.MYSQL_PORT,
username: process.env.MYSQL_USERNAME,
password: process.env.MYSQL_PASSWORD,
database: process.env.MYSQL_DATABASE,
namingStrategy: new SnakeNamingStrategy(),
entities: [
'src/modules/**/*.entity{.ts,.js}',
],
migrations: [
'src/migrations/*{.ts,.js}',
],
};