domco

Deploy

Run vite build to build your application into dist/.

.
└── dist/
	├── client/
	│	├── _immutable/
	│	└── index.html
	└── server/
		├── app.js
		└── (adapter-entry.js)

By default domco will generate a app.js module and static assets for your application.

Example

If you are not using an adapter, you can import createApp from the app.js module and configure your app to use in one of Hono’s supported environments.

The client/ directory holds client assets. JS and CSS assets with hashed file names will be output to dist/client/_immutable/, you can serve this path with immutable cache headers. Other assets are processed and included in dist/client/ directly.

Here’s an example of how to serve your app using the result of your build with @hono/node-server.

// server.js
// import from build output
import { createApp } from "./dist/server/app.js";
import { serve } from "@hono/node-server";
import { serveStatic } from "@hono/node-server/serve-static";

const app = createApp({
	middleware: [{ path: "/*", handler: serveStatic({ root: "./dist/client" }) }],
});

serve(app);

Run this module to start your server.

node server.js

Adapters

Add a deployment adapter within your Vite config to output your app to a different target with no additional configuration.

// vite.config
import { domco } from "domco";
// import adapter
import { adapter } from "domco/adapter/vercel";
import { defineConfig } from "vite";

export default defineConfig({
	plugins: [
		domco({
			// add to your domco config
			adapter: adapter({
				// options...
			}),
		}),
	],
});

Cloudflare

The Cloudflare adapter outputs your app to work on Cloudflare Pages.

A screenshot of the Cloudflare Build Settings UI. Set the Framework Preset field to "None", set the build command to "npm run build", and the build output directory to ".cloudflare".

  • Functions run on the Workers Runtime.
  • Outputs public assets to be served on Cloudflare’s CDN.

Vercel

The Vercel adapter outputs your app to the Build Output API specification.

A screenshot of the Vercel Build and Development Settings UI. Set the Framework Preset field to "Other" and leave all of the other options blank.

Edit this page