1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-27 16:10:57 -05:00
denoland-deno/net
2018-12-18 23:30:44 -05:00
..
bufio.ts Add format script. 2018-12-18 18:56:59 -05:00
bufio_test.ts migrate deno_path to deno_std (denoland/deno_std#26) 2018-12-18 21:29:39 -05:00
file_server.ts Rename project to deno_std 2018-12-18 18:27:05 -05:00
file_server_test.ts Rename project to deno_std 2018-12-18 18:27:05 -05:00
http.ts http: Request body & Streaming (denoland/deno_std#23) 2018-12-18 20:48:05 -05:00
http_bench.ts Rename project to deno_std 2018-12-18 18:27:05 -05:00
http_status.ts Rename project to deno_std 2018-12-18 18:27:05 -05:00
http_test.ts http: Request body & Streaming (denoland/deno_std#23) 2018-12-18 20:48:05 -05:00
iotest.ts Rename project to deno_std 2018-12-18 18:27:05 -05:00
README.md Add colors module (denoland/deno_std#30) 2018-12-18 23:30:44 -05:00
textproto.ts Rename project to deno_std 2018-12-18 18:27:05 -05:00
textproto_test.ts Rename project to deno_std 2018-12-18 18:27:05 -05:00
util.ts Rename project to deno_std 2018-12-18 18:27:05 -05:00

net

Usage:

import { serve } from "https://deno.land/x/net/http.ts";
const s = serve("0.0.0.0:8000");

async function main() {
  for await (const req of s) {
    req.respond({ body: new TextEncoder().encode("Hello World\n") });
  }
}

main();

File Server

A small program for serving local files over HTTP.

Add the following to your .bash_profile

alias file_server="deno https://deno.land/x/net/file_server.ts --allow-net"