Node-Postgres Module
Database integration with Node-Postgres.
const { Pool } = require('pg');
const pool = new Pool({
user: 'postgres',
host: 'localhost',
database: 'postgres',
password: 'mrlzarate',
port: 5432
});
app.get("/hotels", function(req, res) {
pool.query('SELECT * FROM hotels', (error, result) => {
res.json(result.rows);
});
});

Last updated