Created
March 26, 2016 06:23
-
-
Save martinnormark/077c4455b53567dd85f9 to your computer and use it in GitHub Desktop.
Load routes from separate files with hapi.js
This file contains hidden or 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
module.exports = [ | |
{ method: 'GET', path: '/users', handler: function () {} }, | |
{ method: 'GET', path: '/users/{id}', handler: function () {} } | |
]; | |
--- | |
var cart = require('./cart'); | |
var user = require('./user'); | |
module.exports = [].concat(cart, user); | |
--- | |
var routes = require('./config/routes'); | |
... | |
server.route(routes); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment