Last active
August 29, 2015 14:14
-
-
Save ivanoats/446c35f92a0516092447 to your computer and use it in GitHub Desktop.
updated createServer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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