Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthias Schuetz matthias-schuetz

View GitHub Profile
@matthias-schuetz
matthias-schuetz / auto_reload.js
Created Aug 14, 2015
node.js web server with browser reload functionality
View auto_reload.js
var connect = require('connect');
var serveStatic = require('serve-static');
var http = require('http');
var path = require('path');
var tinylr = require('tiny-lr')();
var chokidar = require('chokidar');
var tinylrPort = 2000;
var httpPort = 3000;
var readline;
var app;
@matthias-schuetz
matthias-schuetz / simple_web_server.js
Last active Jun 7, 2016
node.js simple web server
View simple_web_server.js
var connect = require('connect');
var serveStatic = require('serve-static');
var http = require('http');
var app = connect().use(serveStatic(__dirname));
http.createServer(app).listen(3000);
You can’t perform that action at this time.