Skip to content

Instantly share code, notes, and snippets.

@cuth
Created April 14, 2014 17:21
Show Gist options
  • Save cuth/10667008 to your computer and use it in GitHub Desktop.
Save cuth/10667008 to your computer and use it in GitHub Desktop.
Run a local express server on the current directory's static files using node
var host = "127.0.0.1";
var port = 1337;
var express = require("express");
var app = express();
app.use('/', express.static(__dirname + '/'));
app.listen(port, host);
console.log('Running server at http://localhost:' + port + '/');
@codedcontainer
Copy link

This worked great. Just what I needed!

@neaumusic
Copy link

thank you sir

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