var config; var logger; var name = require('path').basename(__filename); var http = require('http'); var nsr = require('node-simple-router'); var router = nsr(); var httpServer; function onGetChipsIndex(request, response) { response.end(); } function onGetDenomsIndex(request, response) { response.end(); } function createServer() { router.get('/chips', onGetChipsIndex); router.get('/denoms', onGetDenomsIndex); httpServer = http.createServer(router).listen(config.httpserver.listen_port); console.log('HTTP server listens on port ' + config.httpserver.listen_port); } function start(_config, _logger) { config = _config; logger = _logger; logger.info('Starting http server'); createServer(); } exports.start = start;