summaryrefslogtreecommitdiff
path: root/runtime/js/40_http.js
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/js/40_http.js')
-rw-r--r--runtime/js/40_http.js20
1 files changed, 8 insertions, 12 deletions
diff --git a/runtime/js/40_http.js b/runtime/js/40_http.js
index 22288b5d5..afacf7b27 100644
--- a/runtime/js/40_http.js
+++ b/runtime/js/40_http.js
@@ -1,15 +1,11 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-"use strict";
+const core = globalThis.Deno.core;
+const ops = core.ops;
+import { HttpConn } from "internal:ext/http/01_http.js";
-((window) => {
- const core = window.__bootstrap.core;
- const ops = core.ops;
- const { HttpConn } = window.__bootstrap.http;
+function serveHttp(conn) {
+ const rid = ops.op_http_start(conn.rid);
+ return new HttpConn(rid, conn.remoteAddr, conn.localAddr);
+}
- function serveHttp(conn) {
- const rid = ops.op_http_start(conn.rid);
- return new HttpConn(rid, conn.remoteAddr, conn.localAddr);
- }
-
- window.__bootstrap.http.serveHttp = serveHttp;
-})(globalThis);
+export { serveHttp };