Skip to content

Instantly share code, notes, and snippets.

@juandopazo
Created February 6, 2014 17:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save juandopazo/8849263 to your computer and use it in GitHub Desktop.
You can expect this to be Node code in <2 years
import { readFile } from 'fs';
import { createServer } from 'http';
createServer(async function (req, res) {
try {
var content = await readFile('foo.html');
res.end(content);
} catch (e) {
res.end('ouch!');
}
}).listen();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment