Skip to content

Commit

Permalink
Upgrade Deno to v1.46 (#9230)
Browse files Browse the repository at this point in the history
* Upgrade Deno to v1.46

Uses the new `deno serve --parallel` feature

* Fix
  • Loading branch information
littledivy authored Aug 27, 2024
1 parent b356e76 commit 5ec9c62
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
4 changes: 2 additions & 2 deletions frameworks/TypeScript/deno/deno.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM denoland/deno:1.42.1
FROM denoland/deno:1.46.1

EXPOSE 8080

Expand All @@ -12,4 +12,4 @@ RUN deno cache main.ts

EXPOSE 8080

CMD ["run", "-A", "--unstable-net", "spawn.ts"]
CMD ["deno", "serve", "--parallel", "--port", "8080", "--host", "0.0.0.0", "-A", "main.ts"]
13 changes: 3 additions & 10 deletions frameworks/TypeScript/deno/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const HELLO_WORLD_STR = "Hello, World!";
const options: ResponseInit = { headers: { "Server": "Deno" } };

Deno.serve({
reusePort: true,
handler: (req: Request) => {
export default {
fetch: (req: Request) => {
const path = req.url.slice(req.url.indexOf("/", 8));
if (path == "/plaintext") {
return new Response(HELLO_WORLD_STR, options);
Expand All @@ -13,10 +12,4 @@ Deno.serve({
return new Response("404 Not Found", { status: 404, ...options });
}
},
onError(err) {
console.error(err);
Deno.exit(9);
},
port: 8080,
hostname: "0.0.0.0",
});
};
13 changes: 0 additions & 13 deletions frameworks/TypeScript/deno/src/spawn.ts

This file was deleted.

0 comments on commit 5ec9c62

Please sign in to comment.