Scan your whole stack
From OX Research Newsroom
Are you using @ngrok/app-server?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.5.4
@ngrok/app-server was last scanned on 23 Nov 2026 at version 0.5.4. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.5.4 LATEST | 23 Nov 2026 | No rules fired |
| 0.5.3 | 21 Nov 2026 | No rules fired |
| 0.5.1 | 16 Nov 2026 | No rules fired |
| 0.5.0 | 14 Nov 2026 | Not shown |
| 0.4.1 | 12 Nov 2026 | Not shown |
Findings for v0.5.4. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.5.4; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A composable Hono app server for React Router and TanStack Start apps. It replaces @react-router/serve, and it runs the same request pipeline in development and production, on Node, Bun, and Deno, or as a Vercel Function.
@react-router/serve@react-router/serve 8.5.1 is Express 5 with compression(), express.static for the client build, and a morgan text log that comes after the static files. app-server serves the same build faster. It also does more work for each request.
On the React Router fixture app of this repo, app-server answers more requests each second than @react-router/serve on each route:
| Route | app-server |
@react-router/serve |
Change |
|---|---|---|---|
/, a prerendered page |
27,353 | 17,611 | +55% |
/ssr, a rendered page |
5,648 | 2,401 | 2.4× |
/assets/*.js, 233 kilobytes (KB), 68 KB as brotli |
22,491 | 2,006 | 11× |
/hello.txt, a prerendered file of 5 bytes |
29,131 | 22,278 | +31% |
The table gives requests per second for a client that sends Accept-Encoding: gzip, deflate, br, as a browser does. Most of the large gains come from compression. compression() compresses each response with brotli for each request, and app-server sends the copy that the build wrote.
With no Accept-Encoding, the gains are +17% for /, +15% for /ssr, +31% for /assets/*.js, and +23% for /hello.txt. In these numbers, app-server also adds the security headers, a request ID, a JSON log line, and the build ID to each response.
A CDN that keeps the /assets/* files makes the asset gain smaller for a visitor.
How we measured:
pnpm run build, then build test/fixtures/react-router with react-router build.node build/server/app-server.js and pnpm exec react-router-serve build/server/index.js, with NODE_ENV=production. Each server is one process. pnpm install installs @react-router/serve as a development dependency of this repo.oha -z 5s -c 64: 64 connections for 5 seconds. Use --disable-compression for the runs with no Accept-Encoding.app-server got more requests each second in each round.@react-router/serve 8.5.1, Express 5.3.0, compression 1.8.2, and oha 1.16.0. The machine is one Apple M3 Max with macOS.llms.txt, sitemap.xml, a JSON API file) and each .data file keep the headers their loader sent: Content-Type, Cache-Control, CORS.compression() compresses each response again for each request.X-Request-Id.@react-router/serve closes the server on SIGTERM, with no deadline and no readiness probe.For a marketing site:
noindex for preview deploys.Vary: Accept and a Link header.<video> from the client build.PUBLIC_ values go into each HTML document at serve time.For a web app:
/livez and /readyz, and a delay before the drain.Cache-Control: private on each rendered page and data response with no Cache-Control, so a shared cache never keeps them for one user.For each app:
defaultPlugins(), a request body over 10 mebibytes (MiB) gets a 413, and a page URL with a trailing slash gets a 308. Change both with the options of defaultPlugins().serverBundles, and the app must serve at /. See Limits.pnpm add -E @ngrok/app-server hono
Hono is a peer dependency, so the app and the package share one copy of it. A middleware of the app's Hono, such as cors() from hono/cors, then fits the middleware of a plugin.
The server has three layers:
createServer. It imports Hono and nothing else.react-router and tanstack-start come with the package.node and vercel come with the package. node runs one long-lived process on Node, Bun, or Deno, such as in a Docker image. vercel runs the pipeline in one Vercel Function. See Deploy to Vercel.Each adapter has a build side, which the Vite plugin uses, and a run side, which the server build imports.
Add the Vite plugin next to the framework's plugin. For React Router:
// vite.config.ts
import { appServer } from "@ngrok/app-server/vite";
import { reactRouter } from "@react-router/dev/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [reactRouter(), appServer()],
});
For TanStack Start:
// vite.config.ts
import { appServer } from "@ngrok/app-server/vite";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import viteReact from "@vitejs/plugin-react";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [tanstackStart(), viteReact(), appServer()],
});
appServer has four options. Each one has a default:
framework: the framework adapter. Default: the adapter of the framework plugin in the Vite config. The plugin of React Router is reactRouter(), and the plugin of TanStack Start is tanstackStart(). If the config has neither plugin or both, Vite stops with an error. Then pass reactRouterAdapter() from @ngrok/app-server/react-router/vite or tanstackStartAdapter() from @ngrok/app-server/tanstack-start/vite.host: the host adapter. Default: node() from @ngrok/app-server/node/vite.app: the module whose default export is the app, relative to the Vite root. Default: server.ts, else server.js, in the Vite root. If neither file exists, the server uses the default plugins. An app path with no module stops app-server start and the build, with an error that names the path.externals: how the server build copies the packages that stay external. whole lists packages that keep each file, and omit lists packages that the build does not copy. Default: no package in either list. See Deploy.clientErrorsPath: the path of the endpoint of errors() for the client errors. Default /_app/issues. The plugin writes it into each build and gives it to the server.An option that you set replaces its default. Set it for a third-party adapter or for an app in another file:
appServer({ framework: reactRouterAdapter(), host: node(), app: "./src/app.ts" });
Write the server. Its default export is the app:
// server.ts
import { createServer, defaultPlugins } from "@ngrok/app-server";
export default createServer({ plugins: defaultPlugins() });
defaultPlugins() answers the health probes at /livez and /readyz, and sends the build ID that tells an open tab about a deploy. Its options turn on the other plugins, each in its correct place. See The pipeline.
Run it:
{
"scripts": {
"start": "app-server start",
"serve": "app-server serve"
}
}
appServer adds server/app-server.js to the server build, next to the framework's own entry, which does not change. The file bundles server.ts with the framework's server module, so the server gets the app's path aliases and its one copy of the framework. The build also bundles the dependencies, so the build directory runs with no install. See Deploy.
After the build and after the prerender pass, appServer writes a gzip copy (.<file>.gz) and a brotli copy (.<file>.br) next to each compressible file of 1 kibibyte (KiB) or more in the client build, HTML pages included. A compressible file has a text type, a type with a +json or +xml suffix (such as an RSS feed), or another type that compresses well: JSON, JavaScript, WebAssembly, YAML, a shell script, an icon (.ico, .bmp), or a TrueType, OpenType, or Embedded OpenType font. A WOFF or WOFF2 font is compressed already, so it gets no copy. The build reads the type of a file from its extension, with the content types of the framework adapter. So a React Router .data file, which the server sends as text/x-script, gets its copies. The build does not read the Content-Type that the prerender pass recorded, so give a prerendered resource a file extension, such as /feed.xml, to get its copies. It writes the gzip copy when it is smaller than the file, and the brotli copy when it is smaller than the gzip copy. A host can ask for fewer copies: on the vercel host, the build writes only the brotli copy, when it is smaller than the file, and no copy of a file that the CDN serves. app-server serve sends the copy that the client's Accept-Encoding prefers, brotli before gzip, so it does not compress the file for each request. Each copy is a dotfile, so it has no URL of its own: a skip rule or an auth check for the file also blocks its copies. The build does not change a .gz or .br file of the app. A link, and a file in a linked directory, get no copy, so the build writes only inside the client build. The copies include the prerendered files, in any plugin order. With appServer after the framework's plugin, as in the examples above, the build writes the copies one time, after the prerender pass. With appServer first, the build writes the copies before the pass, and then the copies of the files that the pass changed. The brotli copies use quality 9, not 11: on a docs build with 70 megabytes (MB) of text, quality 11 adds 46 s to the build, and quality 9 adds 0.6 s for copies that are 9% larger. appServer gives a list of Vite plugins, so put it in plugins as it is.
The build exports appServer, and the CLI calls it. So the copy of this package in the build runs the server, and the CLI's copy runs nothing. The CLI refuses a build from a version of this package with another entry protocol.
A React Router app with no Vite plugin also works: app-server serve build/server/index.js reads a plain React Router build and runs it with the CLI's copy, the node host, and the default plugins. In that build, a route that calls shutdownSignal(), eventStream(), requestContext(), logger(), or cspNonce(), or that reads appServerContext, must import the CLI's copy, so do not bundle @ngrok/app-server into it.
app-server start: development. Vite in middleware mode inside the pipeline, with HMR on the same port. It needs the appServer plugin. Each request loads the latest server entry, so an edit to a route or to server.ts applies at once. A Vite plugin gets the CLI's HTTP server as server.httpServer in its configureServer hook, so it can wait for listening and close. From listening on, the plugin reads the URLs of the server from server.resolvedUrls. A Vite restart, such as after an edit to vite.config.ts, keeps that server open. So a new plugin instance gets no listening, and the old instance gets close only at exit. To clean up for each instance, use Vite's closeServer hook. The port is --port, else PORT, else Vite's server.port. When that port is in use, start tries each next port, unless Vite's server.strictPort is true. The host is HOST, else Vite's server.host. start reports a port in use and prints its URLs as vite dev does, through Vite's logger, so Vite's logLevel and customLogger apply. With server.strictPort, a port in use stops start with the error Port <port> is already in use. When Vite's server.open is set, start opens the browser after it prints the URLs. As in vite dev, Vite also sends one request for that URL then, so the app renders the page one time at startup. The other log lines of start, such as a failed request, and the lines of an app with the default logger, use the text format of Go's log/slog, not JSON. start serves HTTP only, because the CLI makes its HTTP server before Vite reads the config. So start ignores a server.https that has HTTPS on, with a warning, and Vite's check of the Host header stays on. For HTTPS in development, put a proxy or a tunnel that ends TLS in front of start, and add its host to server.allowedHosts. On SIGTERM or SIGINT, it stops Vite and the server, then exits.node build/server/app-server.js: production, with no install. Use dist/server/app-server.js for TanStack Start. It reads PORT and HOST, and it drains on SIGTERM, on SIGINT, and after an uncaught error, as app-server serve does. It has no --port. It sets NODE_ENV to production when NODE_ENV has no value.app-server serve [path]: production. With no path, it runs the first of build/server/app-server.js (React Router), dist/server/app-server.js (TanStack Start), and build/server/index.js (a plain React Router build). The port is --port, else PORT, else 3000. The host is HOST, else every interface. A port or a host that the app gives to tcp() wins over them, with no message, so leave both out of tcp() to let the operator choose. A port in use stops startup at once. A failed start, such as a port in use, a bad PORT, or a plugin setup that throws, writes one startup failed line with the error to the log, and the process exits with code 1. An error that comes before the server exists, such as a bad TRUST_FORWARDED_PROTO or a bad option of createServer, has no log line: the runtime prints the error, and the process exits with code 1. On SIGTERM or SIGINT, it drains, then exits, even when the app left a timer. After an uncaught error, it logs the error, drains, then exits with code 1. A server process serves the client build that was there at start. A deploy starts a new process.-p is short for --port. --help, or -h, writes the usage. A bad argument writes a message and the usage, and exits with code 1. So does serve when it finds no file at the build path.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.