Skip to content

Instantly share code, notes, and snippets.

View michaeltroy's full-sized avatar

Michael michaeltroy

  • Newcastle, Australia
View GitHub Profile
@hectorcorrea
hectorcorrea / webserver.js
Last active June 29, 2024 12:51
web server in node.js
// A very basic web server in node.js
// Stolen from: Node.js for Front-End Developers by Garann Means (p. 9-10)
var port = 8000;
var serverUrl = "127.0.0.1";
var http = require("http");
var path = require("path");
var fs = require("fs");
var checkMimeType = true;