Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.