Skip to content

Instantly share code, notes, and snippets.

@guange2015
Created December 6, 2012 08:56
Show Gist options
  • Select an option

  • Save guange2015/4222972 to your computer and use it in GitHub Desktop.

Select an option

Save guange2015/4222972 to your computer and use it in GitHub Desktop.
node.js创建静态服务器
var connect = require('connect')
, http = require('http');
var app = connect()
.use(connect.logger('dev'))
.use(connect.static('/Users/hhuai/Downloads'))
.use(connect.directory('/Users/hhuai/Downloads'));
http.createServer(app).listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment