Created
June 30, 2020 16:30
-
-
Save shiqimei/05664208059e477dac57773d01b73b3a to your computer and use it in GitHub Desktop.
This file contains hidden or 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/std/http/server.ts'; | |
const server = serve({ port: 1234 }); | |
for await (const req of server) { | |
const body = new TextDecoder() | |
.decode(await Deno.readAll(req.body)); | |
console.log(JSON.parse(body); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment