Code
HTTP
// This val will respond with a colorful and fun HTML page
export default async function main(): Promise<Response> {
const htmlContent = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Fun Page</title>
<style>
body {
font-family: 'Comic Sans MS', cursive;
background: linear-gradient(to right, #30cfd0, #330867);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
}
h1 {
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
font-size: 3rem;
}
</style>
</head>
<body>
<h1>Welcome to the Fun Page!</h1>
</body>
</html>
`;
// Respond with HTML content
return new Response(htmlContent, {
headers: {
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
janpaul123-valle_tmp_305701972711345937273198924748763.web.val.run
Updated: July 17, 2024