Scrollback
Articles Bookmarks Twitter Digests Newsletter Runs
Back to Twitter
Bun @bunjavascript

Add a React frontend to your Express app in 7 lines of code with Bun

import useStatic from "bun-use-static";
import app from "./my-express-app";
import mySinglePageApp from "./dashboard.html";

// Get the node:http Server from calling app.listen()
const server = app.listen(3000, () => {
  console.log(`Example app listening on port 3000`);
});

useStatic(server, {
  "/dashboard": mySinglePageApp,
});
Jan 17, 2025 View on X →
https://x.com/bunjavascript/status/1880117033037361431
Friday, January 17, 2025
Twitter 935 likes 47 retweets 245 bookmarks ID: 1880117033037361431
Curated insights from your reading list v1.0