New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@remix-run/serve

Package Overview
Dependencies
Maintainers
2
Versions
1057
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remix-run/serve - npm Package Compare versions

Comparing version 0.0.0-experimental-149e932f to 0.0.0-experimental-21ec8370

env.js

34

cli.js
#!/usr/bin/env node
/**
* @remix-run/serve v0.0.0-experimental-149e932f
* @remix-run/serve v0.0.0-experimental-21ec8370
*

@@ -16,2 +16,3 @@ * Copyright (c) Remix Software Inc.

var path = require('path');
var os = require('os');
var index = require('./index');

@@ -22,4 +23,10 @@

var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
let port = process.env.PORT || 3000;
let port = Number.parseInt(process.env.PORT || "3000", 10);
if (Number.isNaN(port)) {
port = 3000;
}
let buildPathArg = process.argv[2];

@@ -34,4 +41,21 @@

let buildPath = path__default["default"].resolve(process.cwd(), buildPathArg);
index.createApp(buildPath).listen(port, () => {
console.log(`Remix App Server started at http://localhost:${port}`);
});
let onListen = () => {
var _Object$values$flat$f;
let address = process.env.HOST || ((_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);
if (!address) {
console.log(`Remix App Server started at http://localhost:${port}`);
} else {
console.log(`Remix App Server started at http://localhost:${port} (http://${address}:${port})`);
}
};
let app = index.createApp(buildPath);
if (process.env.HOST) {
app.listen(port, process.env.HOST, onListen);
} else {
app.listen(port, onListen);
}

8

index.js
/**
* @remix-run/serve v0.0.0-experimental-149e932f
* @remix-run/serve v0.0.0-experimental-21ec8370
*

@@ -28,7 +28,11 @@ * Copyright (c) Remix Software Inc.

let app = express__default["default"]();
app.disable("x-powered-by");
app.use(compression__default["default"]());
app.use(express__default["default"].static("public", {
app.use("/build", express__default["default"].static("public/build", {
immutable: true,
maxAge: "1y"
}));
app.use(express__default["default"].static("public", {
maxAge: "1h"
}));
app.use(morgan__default["default"]("tiny"));

@@ -35,0 +39,0 @@ app.all("*", mode === "production" ? express$1.createRequestHandler({

{
"name": "@remix-run/serve",
"description": "Production application server for Remix",
"version": "0.0.0-experimental-149e932f",
"version": "0.0.0-experimental-21ec8370",
"license": "MIT",

@@ -18,3 +18,3 @@ "repository": {

"dependencies": {
"@remix-run/express": "0.0.0-experimental-149e932f",
"@remix-run/express": "0.0.0-experimental-21ec8370",
"compression": "^1.7.4",

@@ -21,0 +21,0 @@ "express": "^4.17.1",

@@ -8,3 +8,3 @@ # Welcome to Remix!

```sh
$ npx create-remix@latest
npx create-remix@latest
```

@@ -11,0 +11,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc