diff options
Diffstat (limited to 'runtime/js/40_http.js')
-rw-r--r-- | runtime/js/40_http.js | 14 |
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); |