diff options
Diffstat (limited to 'net/README.md')
| -rw-r--r-- | net/README.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/README.md b/net/README.md new file mode 100644 index 000000000..65f2b9ad7 --- /dev/null +++ b/net/README.md @@ -0,0 +1,26 @@ +# net + +Usage: + +```typescript +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" +``` |
