Skip to content

Commit 4d22be7

Browse files
zhangyuangczy88840616
authored andcommitted
fix: listen port (#4399)
* fix: listen port * fix: listen port
1 parent a130c78 commit 4d22be7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/web-koa/src/framework.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,11 @@ export class MidwayKoaFramework extends BaseFramework<
326326

327327
if (customPort === 0 || customPort === '0') {
328328
customPort = await getFreePort();
329-
this.configurationOptions.listenOptions.port = customPort;
330329
this.logger.info(
331330
`Midway koa is listening on port ${customPort} (auto assigned)`
332331
);
333332
}
334-
333+
this.configurationOptions.listenOptions.port = Number(customPort);
335334
if (this.configurationOptions.listenOptions.port) {
336335
new Promise<void>(resolve => {
337336
// 使用 ListenOptions 对象启动服务器

0 commit comments

Comments
 (0)