one serve

Serve your web apps for production with one serve, after you've successfully run one build.

It takes the following arguments:

Terminal

--host # string, set the hostname to bind to
--port # string, set the port to bind to
--platform # node | vercel, instructs Hono server to use adapter
--compress # boolean, enable gzip compression, defaults to true
--cacheHeaders # boolean, sets no-cache headers, defaults to true

One comes with a serve command that is powered by Hono.

The compress flag is default on and uses compress.

If cacheHeaders is not set to false, it will set this by default:

if (!c.req.header('Cache-Control')) {
c.header('Cache-Control', 'no-store')
c.header('Vary', '*')
}

This is mostly because Safari can aggressively cache things, even with query strings. We highly recommend using a CDN for your static assets, but you can set this to false or use the plugin to hook into server.beforeStart and set your own Cache-Control headers.

Edit this page on GitHub.