db.ts 293 B

123456
  1. const Sequelize = require('sequelize')
  2. const pkg = require('../../package.json')
  3. const dbName = pkg.name + (process.env.NODE_ENV === 'test' ? '-test' : '')
  4. const dbUrl = process.env.DATABASE_URL || `postgres://localhost:5432/${dbName}`
  5. export default new Sequelize(dbUrl, { logging: false })