Merge branch 'db' into service
* db: 添加 Redis连接的类型声明 添加 Mysql连接的Port配置
This commit is contained in:
@@ -6,6 +6,7 @@ const config = {
|
|||||||
},
|
},
|
||||||
mysql: {
|
mysql: {
|
||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
|
port: 3306,
|
||||||
database: '',
|
database: '',
|
||||||
user: 'root',
|
user: 'root',
|
||||||
password: ''
|
password: ''
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class MySQLConnectPool {
|
|||||||
return mysql.createPool({
|
return mysql.createPool({
|
||||||
host: config.mysql.host,
|
host: config.mysql.host,
|
||||||
database: config.mysql.database,
|
database: config.mysql.database,
|
||||||
|
port: config.mysql.port,
|
||||||
user: config.mysql.user,
|
user: config.mysql.user,
|
||||||
password: config.mysql.password,
|
password: config.mysql.password,
|
||||||
waitForConnections: true,
|
waitForConnections: true,
|
||||||
|
|||||||
@@ -41,4 +41,5 @@ class _RedisConnection {
|
|||||||
|
|
||||||
const _redisConnection = new _RedisConnection();
|
const _redisConnection = new _RedisConnection();
|
||||||
const RedisConnection = _redisConnection.getPool();
|
const RedisConnection = _redisConnection.getPool();
|
||||||
export default RedisConnection;
|
export default RedisConnection;
|
||||||
|
export type { Redis };
|
||||||
Reference in New Issue
Block a user