Skip to content

Instantly share code, notes, and snippets.

@ivanoats
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanoats/446c35f92a0516092447 to your computer and use it in GitHub Desktop.
Save ivanoats/446c35f92a0516092447 to your computer and use it in GitHub Desktop.
updated createServer
// jscs:disable requireMultipleVarDecl
'use strict';
var Hapi = require('hapi');
var _ = require('lodash');
var createServer = function(host, port, options) {
var server = new Hapi.Server(options);
server.connection({
host: host || '0.0.0.0',
port: port || 3000
});
server.route({
method: 'GET',
path: '/{param*}',
handler: {
directory: {
path: 'build',
listing: true
}
}
});
return server;
};
module.exports = function(host, port, options) {
return createServer(host, port, options);
};
'use strict';
var createServer = require('./createServer');
module.exports = createServer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment