Skip to content

Commit

Permalink
cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Feb 4, 2012
1 parent 8502bc4 commit 90a216e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
15 changes: 15 additions & 0 deletions bin/slate.coffee
@@ -0,0 +1,15 @@
slate = require 'slate'
{join} = require 'path'

process.argv = process.argv[2..]
[folder, port] = process.argv
throw 'Missing folder parameter' unless folder?
folder = join process.cwd(), folder
port ?= 8080

server = slate.create()
server.root folder
server.enable '404', 'mime', 'static'
server.listen port

console.log "Slate serving #{folder} on port #{port}"
4 changes: 4 additions & 0 deletions bin/slate.js
@@ -0,0 +1,4 @@
#!/usr/bin/env node

require('coffee-script');
module.exports = require('./slate.coffee');
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -6,7 +6,9 @@
"repository":"git://github.com/wearefractal/slate.git",
"author":"Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
"main":"./index.js",

"bin":{
"slate":"./bin/slate.js"
},
"dependencies":{
"coffee-script":"*",
"mime":"*",
Expand Down

0 comments on commit 90a216e

Please sign in to comment.