Changeset 64dc53b for pages/api


Ignore:
Timestamp:
06/11/22 23:50:19 (3 years ago)
Author:
anastasovv <simon@…>
Branches:
main
Children:
4a1a3ca
Parents:
87614a5
Message:

Code cleanings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pages/api/postgre/index.js

    r87614a5 r64dc53b  
    99const Pool = require('pg').Pool
    1010const pool = new Pool({
    11   connectionString: 'postgres://postgres:postgres@db/postgres'
     11  connectionString: `postgres://${process.env.POSTGRES_USER}:${process.env.POSTGRES_PASSWORD}@${process.env.POSTGRES_HOST}/${process.env.POSTGRES_DB}`
    1212});
    1313
     
    2222// }
    2323
    24 // update credits in database
    25 // setInterval(() => {
    26 //   sessions.filter(session => Date.now() - session.lastActivity > 5*60*1000).forEach(session => {
    27 //     pool.query('UPDATE players SET credits = $1 WHERE username = $2', [session.credits, session.username], (error, results) => {
    28 //       if (error) throw error;
    29 //     });
    30 //   });
    31 // }, 5*60*1000)
    3224
    3325export default function handler(req, res) {
Note: See TracChangeset for help on using the changeset viewer.