Sha256: 7aaea023169ef85c9b24698bd75fda4c36d7e68933cae6aa1376f18412fb2961

Contents?: true

Size: 688 Bytes

Versions: 5

Compression:

Stored size: 688 Bytes

Contents

#!/usr/bin/env coffee

cli = require 'cli'

cli.enable('daemon','status')
   .setUsage('static.coffee [OPTIONS]')

cli.parse {
    log:   ['l', 'Enable logging']
    port:  ['p', 'Listen on this port', 'number', 8080]
    serve: [false, 'Serve static files from PATH', 'path', './public']
}

middleware = []

cli.main (args, options) ->

    if options.log
        @debug 'Enabling logging'
        middleware.push require('creationix/log')()

    @debug 'Serving files from ' + options.serve
    middleware.push require('creationix/static')('/', options.serve, 'index.html')
    
    server = @createServer(middleware).listen options.port
    
    @ok 'Listening on port ' + options.port

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/cli/examples/static.coffee
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/cli/examples/static.coffee
exercism-analysis-0.1.1 vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.coffee
trans-0.5.10 template/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.coffee
trans-0.5.9 template/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.coffee