Bun
Bun is a fast, incrementally adoptable all-in-one JavaScript, TypeScript & JSX toolkit.
-
Check Bun’s Vite guide
-
Follow the Node adapter guide
-
Implement the
serverEntrypointusing Bun APIs:src/server.ts import mod from "./handler";import * as http from "node:http";import sirv from "sirv";import { toFetchHandler } from "srvx/node"import { fileURLToPath } from "node:url";const server = Bun.serve({port: 3000,fetch(request) {const response = toFetchHandler(sirv(fileURLToPath(new URL("../client/", import.meta.url)), { dev: true }))(request);if (response.status !== 404) {return response;}return mod.fetch(request);},});console.log("Ready at http://localhost:3000"); -
After the build, run the server with
bun ./dist/server/index.mjs