deno.land / std@0.166.0 / http / bench.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.import { serve } from "./server.ts";
const DEFAULT_PORT = 4500;const addr = Deno.args[0] || `127.0.0.1:${DEFAULT_PORT}`;const encoder = new TextEncoder();const body = encoder.encode("Hello World");const [hostname, p] = addr.split(":");serve(() => new Response(body), { port: (+p || DEFAULT_PORT), hostname });
std

Version Info

Tagged at
a year ago