mirror of
https://github.com/tale/headplane.git
synced 2026-08-22 02:36:38 +00:00
feat: ditch hono
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// MARK: Production Bootstrap
|
||||
//
|
||||
// The production SSR build entry. Imports the React Router request
|
||||
// listener from `./app`, wraps it with static-asset serving (out of
|
||||
// `build/client`) and basename redirect, then binds an http(s) server.
|
||||
//
|
||||
// This file is NOT loaded in dev — `react-router dev` boots through
|
||||
// Vite, and the dev-only `runtime/vite-plugin.ts` dispatches requests
|
||||
// straight to `./app`'s default export.
|
||||
|
||||
import { dirname, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import { composeListener, startHttpServer } from "../../runtime/http";
|
||||
import requestListener, { config } from "./app";
|
||||
|
||||
// `import.meta.url` resolves to `build/server/index.js`; the built
|
||||
// client lives next to it at `build/client/`.
|
||||
const clientDir = resolve(dirname(fileURLToPath(import.meta.url)), "../client");
|
||||
|
||||
startHttpServer({
|
||||
host: config.server.host,
|
||||
port: config.server.port,
|
||||
listener: composeListener({
|
||||
basename: __PREFIX__,
|
||||
staticRoot: clientDir,
|
||||
immutableAssets: true,
|
||||
requestListener,
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user