Platforms

Bun

Run the Bun example in development, then build and start its production server.

Run the example

Install the current Node.js LTS and Vite+. Also install the current Bun release for the production server. Vite development uses Node.js, so keep both runtimes installed. Create a Bun project and install its dependencies:

vp create effront -- my-app --platform bun
cd my-app
vp install
vp dev

Open the local URL printed by Vite. The single page displays Hello, world.

Find the application and server files

The example already contains the host configuration. Start with these files when changing the page or the way the server runs:

FileRole
src/entry.effront.tsxDefines the document layout, one page, and its / route.
src/entry.rsc.tsExports the application's HTTP handler.
src/entry.server.tsStarts the Bun listener with @effront/server/bun and BunRuntime.runMain.
vite.config.tsRegisters effront() and effrontServer().
package.jsonLists dependencies and the start command.

Change <h1>Hello, world</h1> in src/entry.effront.tsx to <h1>Hello, Effront!</h1> and save. The page updates without restarting the server.

Check the production build locally

Stop development, then run these commands from the generated project:

vp build

The build puts the server entry in dist/rsc/server.js and generated browser assets in dist/client/assets. src/entry.server.ts serves those assets at /assets/.

Start the Bun server

After the build, run from examples/bun:

vp run start

The script runs bun dist/rsc/server.js. With PORT and HOST unset, open http://127.0.0.1:3000. This URL serves the built application on Bun. To change the listening address, set PORT and HOST before starting the server.

The minimal example uses @effect/platform-bun in production and @effect/platform-node for development.

For listener and asset options, see the server API reference. See the separate Node.js example for that runtime.