Skip to content

Commit 13b4fb9

Browse files
committed
improvement: attempt to obtain port only when is a valid number
1 parent 71971dd commit 13b4fb9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

npm-audit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h5 class="card-title">
5555
<div class="card">
5656
<div class="card-body">
5757
<h5 class="card-title">
58-
October 14th 2020, 7:29:46 am
58+
October 14th 2020, 7:31:16 am
5959
</h5>
6060
<p class="card-text">Last updated</p>
6161
</div>

src/DevServer/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,14 @@ export class DevServer {
100100
* without manually changing ports inside the `.env` file when
101101
* original port is in use.
102102
*/
103-
PORT = String(
104-
await getPort({
105-
port: [Number(PORT)],
106-
host: HOST,
107-
})
108-
)
103+
if (!isNaN(Number(PORT))) {
104+
PORT = String(
105+
await getPort({
106+
port: [Number(PORT)],
107+
host: HOST,
108+
})
109+
)
110+
}
109111

110112
this.httpServer = new HttpServer(SERVER_ENTRY_FILE, this.appRoot, this.nodeArgs, this.logger, {
111113
PORT,

0 commit comments

Comments
 (0)