wwwwwwwwwwwwwwwwwww

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

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

If you are only using SPA and SSG routes and aren't using loaders, you don't need to use one serve if you don't want to - you can statically serve the results of dist/client using any server you'd like.

You must run a one build before serve.

You can also run your production server programatically:

import { serve } from 'one/serve'
await serve()

Which takes options:

type ServeOptions = {
// you can pass in your own Hono server
app?: Hono
host?: string
port?: number
compress?: boolean
/**
* Whether to run the Vite logic to load .env files before running the server
* @default false
*/
loadEnv?: boolean
}

Edit this page on GitHub.