1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This val responds with "Hello World" to all incoming HTTP requests with crazy CSS gradients
export default async function main(req: Request): Promise<Response> {
const css = `
background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
font-size: 36px;
font-weight: bold;
text-align: center;
padding: 50px;
`;
const html = `<div style="${css}">Hello World</div>`;
return new Response(html, { headers: { "Content-Type": "text/html" } });
}