@remix-run/serve 1.1.0 → 1.2.0-pre.0

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.
Files changed (4) hide show
  1. package/cli.js +12 -2
  2. package/env.js +13 -0
  3. package/index.js +2 -1
  4. package/package.json +2 -2
package/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @remix-run/serve v1.1.0
3
+ * @remix-run/serve v1.2.0-pre.0
4
4
  *
5
5
  * Copyright (c) Remix Software Inc.
6
6
  *
@@ -13,11 +13,13 @@
13
13
 
14
14
  require('./env');
15
15
  var path = require('path');
16
+ var os = require('os');
16
17
  var index = require('./index');
17
18
 
18
19
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
20
 
20
21
  var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
22
+ var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
21
23
 
22
24
  let port = process.env.PORT || 3000;
23
25
  let buildPathArg = process.argv[2];
@@ -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
- console.log(`Remix App Server started at http://localhost:${port}`);
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
+ address = "localhost";
41
+ }
42
+
43
+ console.log(`Remix App Server started at http://${address}:${port}`);
34
44
  });
package/env.js ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @remix-run/serve v1.2.0-pre.0
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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/serve v1.1.0
2
+ * @remix-run/serve v1.2.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -25,6 +25,7 @@ var morgan__default = /*#__PURE__*/_interopDefaultLegacy(morgan);
25
25
 
26
26
  function createApp(buildPath, mode = "production") {
27
27
  let app = express__default["default"]();
28
+ app.disable("x-powered-by");
28
29
  app.use(compression__default["default"]());
29
30
  app.use(express__default["default"].static("public", {
30
31
  immutable: true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@remix-run/serve",
3
3
  "description": "Production application server for Remix",
4
- "version": "1.1.0",
4
+ "version": "1.2.0-pre.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  "remix-serve": "cli.js"
16
16
  },
17
17
  "dependencies": {
18
- "@remix-run/express": "1.1.0",
18
+ "@remix-run/express": "1.2.0-pre.0",
19
19
  "compression": "^1.7.4",
20
20
  "express": "^4.17.1",
21
21
  "morgan": "^1.10.0"