FACG4 / w6_Stop_Go_Cont

http://stop-go-cont.herokuapp.com
0 stars 0 forks source link

1 Line less code, same functionality #31

Open NouraldinS opened 6 years ago

NouraldinS commented 6 years ago

https://github.com/FACG4/w6_Stop_Go_Cont/blob/c8aa4bea45cbdd72155a9fc441d5e29a77dd3f38/src/database/db_connection.js#L17-L26 How about:

const options = {
  host: params.hostname,
  port: params.port,
  database: params.pathname.split('/')[1],
  max: process.env.DB_MAX_CONNECTIONS || 2,
  user: username,
  password: password,
  ssl: params.hostname !== 'localhost'
};