From a9e4ff2029a769737982fcf7e0b7d76d35cf35e4 Mon Sep 17 00:00:00 2001 From: evan Date: Tue, 12 Jul 2022 04:40:12 -0400 Subject: cleanup benchmarks folder (#587) * cleanup benchmarks * run prettier --- bench/react-hello-world/react-hello-world.deno.jsx | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 bench/react-hello-world/react-hello-world.deno.jsx (limited to 'bench/react-hello-world/react-hello-world.deno.jsx') diff --git a/bench/react-hello-world/react-hello-world.deno.jsx b/bench/react-hello-world/react-hello-world.deno.jsx new file mode 100644 index 000000000..2b0bb9b74 --- /dev/null +++ b/bench/react-hello-world/react-hello-world.deno.jsx @@ -0,0 +1,25 @@ +import { renderToReadableStream } from "https://esm.run/react-dom/server"; +import { serve } from "https://deno.land/std@0.146.0/http/server.ts"; +import * as React from "https://esm.run/react"; + +const App = () => ( + + +

Hello World

+ + +); + +const headers = { + headers: { + "Content-Type": "text/html", + "Cache-Control": "no-transform", // disables response body auto compression, see https://deno.land/manual/runtime/http_server_apis#automatic-body-compression + }, +}; + +await serve( + async (req) => { + return new Response(await renderToReadableStream(), headers); + }, + { port: 8080 } +); -- cgit v1.2.3