Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/** @jsxImportSource npm:react **/
import { renderToString } from "npm:react-dom@18/server";
export default (req: Request) => {
return new Response(
renderToString(
<html>
<link rel="stylesheet" href="https://unpkg.com/missing.css@1.1.1" />
<main>
<h1>Hello justinenerio!</h1>
<p>This is your first val. Edit this text!</p>
</main>
</html>,
),
{ headers: { "Content-Type": "text/html" } },
);
};
justinenerio-grayminnow.web.val.run
July 28, 2024