Skip to content

Commit

Permalink
Merge pull request #1675 from liugddx/master
Browse files Browse the repository at this point in the history
自动化测试时服务端测试node默认2分钟没有返回就直接断掉连接,可以手动设置一个超时时间。
  • Loading branch information
hellosean1025 committed Apr 4, 2020
2 parents ed1b9f3 + de23caa commit 98a57d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions config_example.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"port": "3000",
"adminAccount": "[email protected]",
"timeout":120000,
"db": {
"servername": "127.0.0.1",
"DATABASE": "yapi",
Expand Down
7 changes: 6 additions & 1 deletion server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ app.use(async (ctx, next) => {
await next();
});


app.use(koaStatic(yapi.path.join(yapi.WEBROOT, 'static'), { index: indexFile, gzip: true }));

app.listen(yapi.WEBCONFIG.port);

const server = app.listen(yapi.WEBCONFIG.port);

server.setTimeout(yapi.WEBCONFIG.timeout);

commons.log(
`服务已启动,请打开下面链接访问: \nhttp:https://127.0.0.1${
yapi.WEBCONFIG.port == '80' ? '' : ':' + yapi.WEBCONFIG.port
Expand Down

0 comments on commit 98a57d0

Please sign in to comment.