Skip to content

Commit d4c25fa

Browse files
committed
chore: update server boot logic to handle development environment
1 parent 1d8cd18 commit d4c25fa

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

express/src/server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ import { bootWithDetectedPort } from '@arkstack/common'
33
import { env } from './core/utils/helpers'
44

55
await bootWithDetectedPort(async (port) => {
6-
await app.boot(parseInt(env('APP_PORT', String(port)), 10))
6+
if (env('NODE_ENV') === 'development') {
7+
await app.boot(port)
8+
} else {
9+
await app.boot(parseInt(env('APP_PORT', String(port)), 10))
10+
}
711
})

h3/src/server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ import { bootWithDetectedPort } from '@arkstack/common'
33
import { env } from './core/utils/helpers'
44

55
await bootWithDetectedPort(async (port) => {
6-
await app.boot(parseInt(env('APP_PORT', String(port)), 10))
6+
if (env('NODE_ENV') === 'development') {
7+
await app.boot(port)
8+
} else {
9+
await app.boot(parseInt(env('APP_PORT', String(port)), 10))
10+
}
711
})

0 commit comments

Comments
 (0)