bun-serve-express
v2.0.2
Published
Express v5 API compatibility for Bun.serve()
Downloads
3,628
Readme
Bun.serve + Express
Express API compatibility layer for Bun.serve. Highly similar to uWebSockets-express.
Usage
import bunExpress from "bun-serve-express";
const app = bunExpress(/* optional serve options */);
// use existing middleware implementations!
app.use(express.json());
app.use('/', serveIndex(path.join(__dirname, ".."), { icons: true, hidden: true }))
app.use('/', express.static(path.join(__dirname, "..")));
// register routes
app.get("/hello", (req, res) => {
res.json({ hello: "world!" });
});
app.listen(8000);License
MIT
