Skip to content

Instantly share code, notes, and snippets.

@mrjasonweaver
Created October 11, 2012 15:34
Show Gist options
  • Save mrjasonweaver/3873254 to your computer and use it in GitHub Desktop.
Save mrjasonweaver/3873254 to your computer and use it in GitHub Desktop.
Simple static file server with Connect and Node.js
var connect = require('connect');
var port = 9123;
var filepath = '/FILE_PATH'
server = connect.createServer(
connect.favicon()
, connect.logger()
, connect.static(__dirname + filepath)
)
server.listen(port);
console.log("Static file server now running at http://127.0.0.1:"+port)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment