Fix deno example app
This commit is contained in:
parent
d7a2109238
commit
c944013242
1 changed files with 8 additions and 11 deletions
|
@ -1,10 +1,4 @@
|
||||||
import { serve } from "https://deno.land/std@0.86.0/http/server.ts";
|
const bodyContent = `<!DOCTYPE html>
|
||||||
|
|
||||||
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>
|
<html>
|
||||||
<head lang=\"cs\">
|
<head lang=\"cs\">
|
||||||
<meta charset=\"UTF-8\">
|
<meta charset=\"UTF-8\">
|
||||||
|
@ -70,5 +64,8 @@ for await (const request of server) {
|
||||||
</body>
|
</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);
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in a new issue