Sha256: 30bfa2a075b2ab456eadfb14564b24d4c471535b1667a067e6fd52f239966171

Contents?: true

Size: 722 Bytes

Versions: 5

Compression:

Stored size: 722 Bytes

Contents

#!/usr/bin/env node

var cli = require('cli').enable('status', 'daemon');

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

cli.main(function (args, options) {
    var server, middleware = [];
    
    if (options.log) {
        this.debug('Enabling logging');
        middleware.push(require('creationix/log')());
    }

    this.debug('Serving files from ' + options.serve);
    middleware.push(require('creationix/static')('/', options.serve, 'index.html'));
    
    server = this.createServer(middleware).listen(options.port);
    
    this.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.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/cli/examples/static.js
exercism-analysis-0.1.1 vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.js
trans-0.5.10 template/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.js
trans-0.5.9 template/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.js