Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nestjs typeorm

Typeorm.forRoot({
  type: 'postgres',
  host: process.env.DB_HOST,
  port: +process.env.DB_PORT,
  username: process.env.DB_USER,
  password: process.env.DB_PASSWORD,
  database: process.env.DB_NAME,
  entities: ['dist/models/*.js'],
  synchronize: process.env.NODE_ENV !== ('production' || 'staging') ? true : false,
  autoLoadEntities: true
}),
 
PREVIOUS NEXT
Tagged: #nestjs #typeorm
ADD COMMENT
Topic
Name
4+9 =