How to use the args.port function in args

To help you get started, we’ve selected a few args examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matthewmueller / coderunner / index.js View on Github external
/**
 * Module dependencies.
 */

var path = require('path');
var join = path.join;
var express = require('express');
var app = module.exports = express();
var server = require('http').createServer(app);
var Session = require('connect-leveldb')(express);
var engine = require('engine.io');
var IO = require('io-server');
var build = require('build').build;
var conf = require('conf');
var args = require('args');
var port = args.port || 8080;

/**
 * Set up engine.io
 */

var es = new engine.Server();

server.on('upgrade', function(req, socket, head) {
  es.handleUpgrade(req, socket, head);
});

es.on('connection', IO);

/**
 * Configuration
 */