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 factory (Koa) / app instance (Hono)
    β”‚   └── server.js    # bundled API server
    β”œβ”€β”€ client
    β”‚   β”œβ”€β”€ assets/      # scripts, styles, images
    β”‚   └── index.html
    └── ssr
        β”œβ”€β”€ app.js       # SSR app factory (Vite)
        └── 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.

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);

Hono - 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);
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 });

Released under the MIT License.