API's: employee onboarding, authentication through JWT

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Sven laptop
2026-05-05 01:23:03 +02:00
parent 9d29ec49d4
commit 39278dc857
12 changed files with 2576 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
const { Pool } = require('pg');
require('dotenv').config();
const pool = new Pool({
host: process.env.PG_HOST,
port: process.env.PG_PORT,
user: process.env.PG_USER,
password: process.env.PG_PASS,
database: process.env.PG_DB,
max: 10,
idleTimeoutMillis: 30000
});
pool.query('SELECT 1')
.then(() => console.log('PostgreSQL connection OK'))
.catch(err => {
console.error('PostgreSQL connection FAILED');
console.error(err);
process.exit(1);
});
module.exports = {
query: (text, params) => pool.query(text, params),
pool
};