-
-
Save silky/51aa8a71884ab2d56dbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// npm install connect | |
var port = process.argv[2]; | |
var cwd = process.cwd(); | |
if(! port) { | |
throw("Usage: serve <port>"); | |
} | |
console.log("port " + port); | |
console.log("dir " + cwd); | |
var connect = require('connect'); | |
var app = connect() | |
.use(connect.logger('dev')) | |
.use(connect.static(cwd)) | |
connect.createServer( app ).listen(port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment