Skip to content

Commit 79b1a42

Browse files
committed
fix: port 8080 in prod
1 parent b212f23 commit 79b1a42

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/server.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,26 @@ export default class Server {
1515
/** @type {Partial<{ mode: "development" | "staging" | "production"; port: number; base: string }>} */
1616
{ mode, port, base } = {},
1717
) {
18-
/** @type {"development" | "staging" | "production"} */
19-
this.mode = mode || process.env.MODE || "development"
20-
/** @type {number} */
21-
this.port = port || (process.env.PORT ? Number(process.env.PORT) : 5173)
22-
/** @type {string} */
23-
this.base = base || process.env.BASE || "/"
24-
2518
/** @type {boolean} */
2619
this.envIsProduction = process.env.NODE_ENV === "production"
2720
/** @type {string} */
2821
this.templateHtml = ""
2922
/** @type {string} */
3023
this.hostname = this.envIsProduction ? "0.0.0.0" : "127.0.0.1"
3124

25+
/** @type {"development" | "staging" | "production"} */
26+
this.mode = mode || process.env.MODE || "development"
27+
/** @type {number} */
28+
this.port =
29+
port ||
30+
(process.env.PORT
31+
? Number(process.env.PORT)
32+
: this.envIsProduction
33+
? 8080
34+
: 5173)
35+
/** @type {string} */
36+
this.base = base || process.env.BASE || "/"
37+
3238
/** @type {import('express').Express} */
3339
this.app = express()
3440
/** @type {import('vite').ViteDevServer | undefined} */

0 commit comments

Comments
 (0)