1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

添加定时任务,部署相关优化

This commit is contained in:
2023-08-27 23:51:47 +08:00
parent 70e4c8adee
commit b75ec7d6e7
7 changed files with 131 additions and 22 deletions

View File

@@ -2,6 +2,8 @@ const express = require('express');
const mysql = require('mysql');
const app = express();
const port = 35590
// 创建连接池
const pool = mysql.createPool({
connectionLimit: 5, // 设置连接池的大小
@@ -202,7 +204,14 @@ app.post('/api/nuclear_data/export', function (req, res) {
});
});
// 启动服务器
app.listen(3000, function () {
console.log('Server is running on port 3000');
});
function serve() {
// 启动服务器
app.listen(port, function () {
console.log('Server is running on port ' + port);
});
}
module.exports = {
serve,
}