Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

different db connectons depending on env in typeorm

require('dotenv/config');


const database = {
  development: "dev-db",
  production: 'prod-db',
  test: 'test-db'
}

module.exports = {
  type: 'postgres',
  host: 'localhost',
  port: 5432,
  username: 'ur-username',
  password: 'password',
  database: database[process.env.NODE_ENV],
  entities: ['dist/**/*.entity{.ts,.js}'],
  synchronize: true,
  migrationsTableName: 'migration',
  migrations: ['migration/*.js'],
  cli: {
    migrationsDir: 'migration',
  },
};
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to use begins with in aws nodejs 
Javascript :: Load Balance 4 instances of api.js node js 
Javascript :: how to put the value in the fom using javascript 
Javascript :: create react app run test apecific folfer 
Javascript :: vanilla js game loop 
Javascript :: ${product} meaning in react js 
Javascript :: liquid indicators in react native 
Javascript :: The syntax of ScrollBy() methods 
Javascript :: encryption decryption in javascript 
Javascript :: Dynamically bind layouts android with json array 
Javascript :: render one canvas over another 
Javascript :: js string get substring between two characters 
Javascript :: scrollreveal react tutoriel 
Javascript :: exemple de modal reactjs 
Javascript :: call a method of component from outside react 
Javascript :: react router dom two page form 
Javascript :: how to detect keyboard layout js 
Javascript :: how to get selected option attribute value in jquery 
Javascript :: js page head comment 
Javascript :: how to detech ctrl+C exist in nodejs 
Javascript :: navigate to another page on vue js button 
Javascript :: Pignose Calender 
Javascript :: show each element of an array in a different line 
Javascript :: the caller does not have permission firestore 
Javascript :: suisie with c 
Javascript :: videoTitle$ Angular 2 - communication between two sibling components 
Javascript :: alert message in js 
Javascript :: how to convert base64 to webp in angular 
Javascript :: flatpicker js init 
Javascript :: axios post not sending file 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =