1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
denoland-deno/net
2018-12-31 09:06:05 +00: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
extension_map.json Add content-type header to file_server (denoland/deno_std#47) 2018-12-31 09:06:05 +00:00
file_server.ts Add content-type header to file_server (denoland/deno_std#47) 2018-12-31 09:06:05 +00:00
file_server_test.ts Add content-type header to file_server (denoland/deno_std#47) 2018-12-31 09:06:05 +00: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 Make compatible with latest deno (denoland/deno_std#41) 2018-12-23 18:49:46 -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 Avoid textproto crashing on empty reader (denoland/deno_std#50) 2018-12-31 09:00:28 +00: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"