summaryrefslogtreecommitdiff
path: root/std/examples/chat/server.ts
diff options
context:
space:
mode:
authorAli Hasani <a.hassssani@gmail.com>2020-04-30 15:17:53 +0430
committerGitHub <noreply@github.com>2020-04-30 12:47:53 +0200
commitc569d958aaf49db70856a60d75954c83ab8bd95a (patch)
tree80b61ce571ba0fbaeb0df1ed46febf99b743e3fa /std/examples/chat/server.ts
parent4bc9c18fe96a30f2fb8262e3ea139ce628b7f4e5 (diff)
fix(std): use fromFileUrl (#5005)
Diffstat (limited to 'std/examples/chat/server.ts')
-rw-r--r--std/examples/chat/server.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/std/examples/chat/server.ts b/std/examples/chat/server.ts
index 40affbd5f..a86ed737a 100644
--- a/std/examples/chat/server.ts
+++ b/std/examples/chat/server.ts
@@ -5,6 +5,7 @@ import {
WebSocket,
isWebSocketCloseEvent,
} from "../../ws/mod.ts";
+import { fromFileUrl } from "../../path/mod.ts";
const clients = new Map<number, WebSocket>();
let clientId = 0;
@@ -47,7 +48,7 @@ listenAndServe({ port: 8080 }, async (req) => {
});
} else {
// server launched by deno run ./server.ts
- const file = await Deno.open(u.pathname);
+ const file = await Deno.open(fromFileUrl(u));
req.respond({
status: 200,
headers: new Headers({