Skip to content

Instantly share code, notes, and snippets.

@cuth
Created April 14, 2014 17:21
Show Gist options
  • Select an option

  • Save cuth/10667008 to your computer and use it in GitHub Desktop.

Select an option

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 + '/');
@neaucode

neaucode commented Jul 7, 2016

Copy link
Copy Markdown

thank you sir

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