Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cli

  • Loading branch information...
commit 90a216ed815503563b8fbd4c98fc76b500f329de 1 parent 8502bc4
@contra contra authored
Showing with 22 additions and 1 deletion.
  1. +15 −0 bin/slate.coffee
  2. +4 −0 bin/slate.js
  3. +3 −1 package.json
View
15 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}"
View
4 bin/slate.js
@@ -0,0 +1,4 @@
+#!/usr/bin/env node
+
+require('coffee-script');
+module.exports = require('./slate.coffee');
View
4 package.json
@@ -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":"*",
Please sign in to comment.
Something went wrong with that request. Please try again.