Skip to content

Instantly share code, notes, and snippets.

@blairanderson
Created October 2, 2014 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blairanderson/9cab991a2e00be526be3 to your computer and use it in GitHub Desktop.
Save blairanderson/9cab991a2e00be526be3 to your computer and use it in GitHub Desktop.
simple node server
var fs = require('fs')
var path = require('path')
var express = require('express')
var app = express();
app.use(express.static(path.join(__dirname, 'public')));
app.get('*', function(req, res){
res.pipe(fs.createReadStream(path.join(__dirname, 'public', 'index.html')))
})
app.listen(9000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment