web-site/invite-token/app/database.js

17 lines
569 B
JavaScript
Raw Normal View History

2024-11-19 09:52:20 +00:00
import mysql from 'mysql2/promise';
export default () =>
mysql.createPool({
host : process.env.MYSQL_HOST,
user : process.env.MYSQL_USER,
password : process.env.MYSQL_PASSWORD,
database : process.env.MYSQL_DATABASE,
waitForConnections: true,
connectionLimit: 100,
maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`
idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000
queueLimit: 0,
enableKeepAlive: true,
keepAliveInitialDelay: 0,
});