1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

cleanup(bench/deno_http_native): don't use Deno.core funcs (#10460)

`Deno.core.*` is unstable and not fit for public consumption, although this is a somewhat internal bench some people may use it as reference code and start using `Deno.core.encode()` in their own code
This commit is contained in:
Aaron O'Mullan 2021-05-03 01:23:19 +02:00 committed by GitHub
parent 8377957666
commit c9ac851b90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,8 @@ const [hostname, port] = addr.split(":");
const listener = Deno.listen({ hostname, port: Number(port) }); const listener = Deno.listen({ hostname, port: Number(port) });
console.log("Server listening on", addr); console.log("Server listening on", addr);
const body = Deno.core.encode("Hello World"); const encoder = new TextEncoder();
const body = encoder.encode("Hello World");
for await (const conn of listener) { for await (const conn of listener) {
(async () => { (async () => {