summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2018-12-19 15:30:44 +1100
committerRyan Dahl <ry@tinyclouds.org>2018-12-18 23:30:44 -0500
commita3d164df917536c702775af1937569825fc5ceaf (patch)
tree13442b0e8d95049d9220c4477e3da7a941768f1a /net
parent2d58da520fffaeaee1bceeb33b6e3dc339ea68a3 (diff)
Add colors module (denoland/deno_std#30)
Original: https://github.com/denoland/deno_std/commit/54787f172c62df7c98d8e9e534c40e317825e614
Diffstat (limited to 'net')
-rw-r--r--net/README.md26
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"
+```