public
Last active

  • Download Gist
.gitignore
1
node_modules
.jshintrc
JSON
1 2 3 4
{
"asi": true,
"laxcomma": true
}
package.json
JSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
{
"name": "servecwd",
"version": "0.0.1",
"description": "serve your cwd",
"bin": "server.js",
"scripts": {
"start": "node server.js"
},
"repository": {
"type": "git",
"url": "git://gist.github.com/4454240.git"
},
"keywords": [
"ecstatic"
],
"author": "Nathan Zadoks",
"license": "BSD",
"dependencies": {
"ecstatic": "~0.3.0",
"listen-url": "~1.0.0"
}
}
server.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/env node
 
var http = require('http')
, ecstatic = require('ecstatic')
 
http.createServer(
ecstatic({
root: process.cwd,
showDir: true,
autoIndex: true,
cache: 0
})
).listen(process.env.PORT || 0, require('listen-url'))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.