// To run this example: // // bun --hot bun-hot-websockets.js // const css = ([inner]) => { return inner; }; const styles = css` #bun { margin: 0 auto; margin-top: 200px; object-fit: cover; } html, body { margin: 0; padding: 0; } body { background: #f1239f; font-family: "Inter", sans-serif; display: flex; align-items: center; justify-content: center; align-content: center; color: white; } h1 { padding: 0; text-align: center; font-size: 3rem; -webkit-text-stroke: 2px black; } * { box-sizing: border-box; } `; export default { websocket: { message(ws, msg) { ws.send(styles); }, }, fetch(req, server) { if (req.url.endsWith("/hot")) { if (server.upgrade(req)) return new Response("", { status: 101, }); } return new Response( ` WebSockets
Bun

bun --hot websockets

`, { headers: { "Content-Type": "text/html; charset=utf-8", }, }, ); }, }; ase'>changeset-base Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/packages/integrations/prefetch/src (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-06-28Fix Tailwind integration Typescript warning (#3732)Gravatar Victor 2-1/+6
2022-06-27[ci] formatGravatar bholmesdev 2-3/+3
2022-06-27Refactor: remove Deno shim to esbuild "banner" (#3734)Gravatar Ben Holmes 7-15/+22
2022-06-27[ci] formatGravatar FredKSchott 9-23/+25
2022-06-27update telemetry to support more anonymized project id (#3713)Gravatar Fred K. Schott 20-351/+311
2022-06-27SImplify "astro add" by removing confusing multi-select (#3715)Gravatar Fred K. Schott 13-258/+157