Skip to content

Instantly share code, notes, and snippets.

@michaelcpuckett
Created October 16, 2012 15:30
Show Gist options
  • Save michaelcpuckett/3899990 to your computer and use it in GitHub Desktop.
Save michaelcpuckett/3899990 to your computer and use it in GitHub Desktop.
Use any folder on localhost:3000 (for development)
/**
* Module dependencies.
*/
var express = require('express'),
http = require('http');
/**
* Express setup
*/
var app = express();
app.configure(function () {
app.set('port', process.env.PORT || 3000);
app.use(express.static(__dirname));
});
http.createServer(app)
.listen(app.get('port'), function () {
console.log("Express server listening on port " + app.get('port'));
});
@JoshuaEstes
Copy link

I have an alias set up to do this, see my dotfiles repo. You can also do this with php -S

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment