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
// 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" } });
}
janpaul123-valle_tmp_68349873444339632722229399189495.web.val.run
July 17, 2024