summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2021-07-12 12:44:49 +0200
committerGitHub <noreply@github.com>2021-07-12 12:44:49 +0200
commitf649960f87a408124b5b0d6f55f3be7f5724a4e7 (patch)
tree0a303a918828f602623c64c50a912645df55b772 /runtime/js
parent6460eadaa178b3a9d09d04205977e4f659fe8fff (diff)
refactor: deno_http op crate (#11335)
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/40_http.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/js/40_http.js b/runtime/js/40_http.js
new file mode 100644
index 000000000..d68b4f45c
--- /dev/null
+++ b/runtime/js/40_http.js
@@ -0,0 +1,14 @@
+// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
+
+((window) => {
+ const core = window.__bootstrap.core;
+ const { HttpConn } = window.__bootstrap.http;
+
+ function serveHttp(conn) {
+ const rid = core.opSync("op_http_start", conn.rid);
+ return new HttpConn(rid);
+ }
+
+ window.__bootstrap.http.serveHttp = serveHttp;
+})(globalThis);