mirror of
https://gitlab.com/nekoya/web.git
synced 2024-11-14 10:26:40 +01:00
18 lines
No EOL
301 B
JavaScript
18 lines
No EOL
301 B
JavaScript
var mysql = require('mysql2');
|
|
|
|
let config;
|
|
try {
|
|
config = require('../config');
|
|
} catch (e) {
|
|
console.log('No config file found');
|
|
process.exit(0);
|
|
}
|
|
|
|
function connect() {
|
|
const connection = mysql.createConnection(config.db);
|
|
return connection;
|
|
}
|
|
|
|
module.exports = {
|
|
connect
|
|
} |