Created
July 9, 2015 03:32
-
-
Save boxxa/420bfe39fc9cc7aa8637 to your computer and use it in GitHub Desktop.
Quick NodeJS Static Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quick way to serve files in a web server for testing | |
// npm install connect serve-static | |
// node run.js folder | |
var dirPath = process.argv[2]; | |
console.log("Serving: " + dirPath); | |
var connect = require('connect'); | |
var serveStatic = require('serve-static'); | |
connect().use(serveStatic(dirPath)).listen(8080); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment