Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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