Skip to content

Instantly share code, notes, and snippets.

@shiqimei
Created June 30, 2020 16:30
Show Gist options
  • Save shiqimei/05664208059e477dac57773d01b73b3a to your computer and use it in GitHub Desktop.
Save shiqimei/05664208059e477dac57773d01b73b3a to your computer and use it in GitHub Desktop.
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