1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-29 02:29:06 -05:00
denoland-deno/net
2019-01-02 13:45:42 -05:00
..
bufio.ts Add format script. 2018-12-18 18:56:59 -05:00
bufio_test.ts Add testing module 2019-01-02 13:45:42 -05:00
extension_map.json Add testing module 2019-01-02 13:45:42 -05:00
file_server.ts Add mkdirp (denoland/deno_std#59) 2019-01-01 18:45:41 -05:00
file_server_test.ts Add testing module 2019-01-02 13:45:42 -05:00
http.ts Make compatible with latest deno (denoland/deno_std#41) 2018-12-23 18:49:46 -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 Add testing module 2019-01-02 13:45:42 -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 Avoid textproto crashing on empty reader (denoland/deno_std#50) 2018-12-31 09:00:28 +00:00
textproto_test.ts Add testing module 2019-01-02 13:45:42 -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"