Skip to content

Instantly share code, notes, and snippets.

View kairess's full-sized avatar

Brad kairess

View GitHub Profile
@kairess
kairess / static_server.js
Created May 23, 2019 06:25 — forked from amejiarosario/static_server.js
Node.js quick file server (static files over HTTP) using es6+
const http = require('http');
const url = require('url');
const fs = require('fs');
const path = require('path');
const port = process.argv[2] || 9000;
http.createServer(function (req, res) {
console.log(`${req.method} ${req.url}`);
// parse URL