@remix-run/serve 1.0.5 → 1.1.2
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/cli.d.ts +1 -1
- package/cli.js +14 -4
- package/env.d.ts +0 -0
- package/env.js +13 -0
- package/index.js +1 -1
- package/package.json +3 -2
package/cli.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import "./env";
|
package/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @remix-run/serve v1.
|
|
3
|
+
* @remix-run/serve v1.1.2
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -11,14 +11,16 @@
|
|
|
11
11
|
*/
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
require('./env');
|
|
14
15
|
var path = require('path');
|
|
16
|
+
var os = require('os');
|
|
15
17
|
var index = require('./index');
|
|
16
18
|
|
|
17
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
20
|
|
|
19
21
|
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
22
|
+
var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
|
|
20
23
|
|
|
21
|
-
process.env.NODE_ENV = "production";
|
|
22
24
|
let port = process.env.PORT || 3000;
|
|
23
25
|
let buildPathArg = process.argv[2];
|
|
24
26
|
|
|
@@ -30,5 +32,13 @@ if (!buildPathArg) {
|
|
|
30
32
|
|
|
31
33
|
let buildPath = path__default["default"].resolve(process.cwd(), buildPathArg);
|
|
32
34
|
index.createApp(buildPath).listen(port, () => {
|
|
33
|
-
|
|
35
|
+
var _Object$values$flat$f;
|
|
36
|
+
|
|
37
|
+
let address = (_Object$values$flat$f = Object.values(os__default["default"].networkInterfaces()).flat().find(ip => (ip === null || ip === void 0 ? void 0 : ip.family) == "IPv4" && !ip.internal)) === null || _Object$values$flat$f === void 0 ? void 0 : _Object$values$flat$f.address;
|
|
38
|
+
|
|
39
|
+
if (!address) {
|
|
40
|
+
throw new Error("Could not find an IPv4 address.");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
console.log(`Remix App Server started at http://${address}:${port}`);
|
|
34
44
|
});
|
package/env.d.ts
ADDED
|
File without changes
|
package/env.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @remix-run/serve v1.1.2
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Remix Software Inc.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
process.env.NODE_ENV = "production";
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remix-run/serve",
|
|
3
3
|
"description": "Production application server for Remix",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"repository": {
|
|
6
7
|
"type": "git",
|
|
7
8
|
"url": "https://github.com/remix-run/remix",
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
"remix-serve": "cli.js"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
|
-
"@remix-run/express": "1.
|
|
18
|
+
"@remix-run/express": "1.1.2",
|
|
18
19
|
"compression": "^1.7.4",
|
|
19
20
|
"express": "^4.17.1",
|
|
20
21
|
"morgan": "^1.10.0"
|