project restructuring

This commit is contained in:
Alessandro Ferro 2024-02-20 15:04:49 +01:00
parent 4c10159416
commit bb64ccf7e3
2 changed files with 13 additions and 10 deletions

View File

@ -14,16 +14,7 @@
require('dotenv').config();
const bcrypt = require('bcrypt');
const crypto = require('crypto');
const knex = require('knex')({
client: 'pg',
connection: {
host: process.env.POSTGRES_SERVER,
user: process.env.POSTGRES_USERNAME,
password: process.env.POSTGRES_PASSWORD,
port: process.env.POSTGRES_PORT,
database: 'Blink'
}
});
const knex = require('../utils/knex_config');
const jwt = require('jsonwebtoken');
// ======== BEGIN API ENDPOINTS ========

View File

@ -0,0 +1,12 @@
const knexInstance = require('knex')({
client: 'pg',
connection: {
host: process.env.POSTGRES_SERVER,
user: process.env.POSTGRES_USERNAME,
password: process.env.POSTGRES_PASSWORD,
port: process.env.POSTGRES_PORT,
database: 'Blink'
}
});
module.exports = knexInstance;