HBForge/Examples
16 · Integrations

Remix integration

Mount Remix's universal request handler under a wildcard. c.req.raw is the underlying Request — pass it through.

forge/serverNode
Code
with-remix.js
const { WebApp } = require(class="tk-str">'@hyperbridge/forge/server');
const { createRequestHandler } = require(class="tk-str">'@remix-run/server-runtime');
const build = require(class="tk-str">'./build');

const app    = new WebApp();
const handle = createRequestHandler(build, class="tk-str">'production');

app.all(class="tk-str">'*', (c) => handle(c.req.raw));

app.listen(3000);
How it works

Remix expects to be called with a Fetch Requestc.req.raw is exactly that, untouched by HBForge.

Add HBForge middleware before the wildcard for request logging, auth, rate limiting — Remix still owns the actual routing.

Same pattern works for any Fetch-API-compatible framework: SvelteKit, SolidStart, Astro adapters, Qwik City.

Try it
Quickstart
npm run remix-build && node server.js
Related modules