Last active
February 25, 2019 12:48
-
-
Save sunfmin/3bf73c5e1672a7e8dd330cef12aa803d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { test, assertEqual } from "https://deno.land/x/testing/mod.ts"; | |
test(function t1() { | |
assertEqual("hello", "hello"); | |
}); | |
test(function t2() { | |
assertEqual("world", "world"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { serve } from "https://deno.land/x/[email protected]/http/server.ts"; | |
const s = serve("0.0.0.0:8000"); | |
async function main() { | |
for await (const req of s) { | |
console.log("req = ", req) | |
req.respond({ body: new TextEncoder().encode("Hello World\n") }); | |
} | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment