codeforlife 2.6.2 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/server.js +13 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.6.3](https://github.com/ocadotechnology/codeforlife-package-javascript/compare/v2.6.2...v2.6.3) (2024-12-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* port 8080 in prod ([79b1a42](https://github.com/ocadotechnology/codeforlife-package-javascript/commit/79b1a423de37d98c4f392377e47f89d6d2ecc9a9))
|
|
7
|
+
|
|
1
8
|
## [2.6.2](https://github.com/ocadotechnology/codeforlife-package-javascript/compare/v2.6.1...v2.6.2) (2024-12-18)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -15,13 +15,6 @@ export default class Server {
|
|
|
15
15
|
/** @type {Partial<{ mode: "development" | "staging" | "production"; port: number; base: string }>} */
|
|
16
16
|
{ mode, port, base } = {},
|
|
17
17
|
) {
|
|
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
|
-
|
|
25
18
|
/** @type {boolean} */
|
|
26
19
|
this.envIsProduction = process.env.NODE_ENV === "production"
|
|
27
20
|
/** @type {string} */
|
|
@@ -29,6 +22,19 @@ export default class Server {
|
|
|
29
22
|
/** @type {string} */
|
|
30
23
|
this.hostname = this.envIsProduction ? "0.0.0.0" : "127.0.0.1"
|
|
31
24
|
|
|
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
|
+
|
|
32
38
|
/** @type {import('express').Express} */
|
|
33
39
|
this.app = express()
|
|
34
40
|
/** @type {import('vite').ViteDevServer | undefined} */
|