Skip to content

Instantly share code, notes, and snippets.

@trilom
Last active May 22, 2020 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trilom/40d11eb5f61f76a088060ef3830941fa to your computer and use it in GitHub Desktop.
Save trilom/40d11eb5f61f76a088060ef3830941fa to your computer and use it in GitHub Desktop.
deno + typescript = future ❣️🦕

Investigate

> ifconfig | grep 'inet 19'
        inet 192.168.2.20 netmask 0xffffff00 broadcast 192.168.2.255
        inet 192.168.2.215 netmask 0xffff0000 broadcast 192.168.255.255
        inet 192.168.4.99 netmask 0xffff8000 broadcast 192.168.127.255

Install

# install deno *nix
curl -fsSL https://deno.land/x/install/install.sh | sh
# install deno winders
iwr https://deno.land/x/install/install.ps1 -useb | iex

Author

touch index.ts
import { serve } from "https://deno.land/std/http/server.ts";
const s = serve({ hostname: "192.168.2.20", port: 8000 });
for await (const req of s) {
  req.respond({ body: "Hello World\n" });
}

Run

deno run --allow-net index.ts

Success baby.gif

successbaby.gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment