Skip to content

Each source folder builds independently.

sh
pnpm build          # all source folders
pnpm build front    # specific folder

Build Output

txt
dist/
└── front
    ├── api
    │   ├── app.js       # app instance
    │   └── server.js    # ready-to-use API server
    ├── client
    │   ├── assets/      # scripts, styles, images
    │   └── index.html
    └── ssr
        ├── app.js       # SSR app instance
        └── server.js    # SSR server bundle

The SSR output is only present when SSR is enabled.

Running in Production

The simplest deployment - just run the bundled server directly:

sh
node dist/front/api/server.js

For more control, use the app factory at dist/*/api/app.js.

Hono / H3 - app.fetch is a Web Fetch API handler, so it plugs into each runtime's native server directly:

js
import { createServer } from "node:http";
import { getRequestListener } from "@hono/node-server";

import app from "./dist/front/api/app.js";

createServer(getRequestListener(app.fetch)).listen(3000);
js
import { createServer } from "node:http";
import { toNodeHandler } from "h3/node";

import app from "./dist/front/api/app.js";

createServer(toNodeHandler(app)).listen(3000);
ts
import app from "./dist/front/api/app.js";

Deno.serve({ port: 3000 }, app.fetch);
ts
import app from "./dist/front/api/app.js";

Bun.serve({ port: 3000, fetch: app.fetch });

Koa - app.callback() is a Node.js (IncomingMessage, ServerResponse) handler. Deno and Bun support it via their node:http compat layer, not via their native serve APIs:

Node / Deno / Bun
js
import { createServer } from "node:http";

import app from "./dist/front/api/app.js";

createServer(app.callback()).listen(3000);

Or use app.listen() directly for Node only support:

Node
js
import app from "./dist/front/api/app.js";

app.listen(3000);

Released under the MIT License.