Fix deno example app
All checks were successful
Test build / build (push) Successful in 42m57s
Release into production / build (release) Successful in 2m20s

This commit is contained in:
Adam Štrauch 2025-05-05 20:58:39 +02:00
parent d7a2109238
commit c944013242
Signed by: cx
GPG key ID: 7262DAFE292BCE20

View file

@ -1,11 +1,5 @@
import { serve } from "https://deno.land/std@0.86.0/http/server.ts";
const server = serve({ hostname: "0.0.0.0", port: 8080 });
console.log(`HTTP webserver running. Access it at: http://localhost:8080/`);
for await (const request of server) {
let bodyContent = `<!DOCTYPE html>
<html>
const bodyContent = `<!DOCTYPE html>
<html>
<head lang=\"cs\">
<meta charset=\"UTF-8\">
<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">
@ -68,7 +62,10 @@ for await (const request of server) {
}
</script>
</body>
</html>`;
</html>`;
request.respond({ status: 200, body: bodyContent });
}
console.log(`HTTP webserver running. Access it at: http://localhost:8080/`);
Deno.serve({ port: 8080 }, (_req) => {
return new Response(bodyContent);
});