Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const mysql = require('mysql');
- const pool = mysql.createPool({
- host: process.env.host,
- user: process.env.user,
- password: process.env.password,
- database: process.env.database,
- waitForConnections: true,
- connectionLimit: 10,
- queueLimit: 0
- });
- if (!pool.getConnection(function(err) {console.error('Error connecting to database: ' + err.stack); return;})) {
- return;
- }
- console.info('Connected to database');
- pool.query("SELECT * FROM societies");
- module.exports = pool;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement