Last active
July 20, 2018 05:32
-
-
Save pajtai/119674023fdb3a0e5822747e9129933e to your computer and use it in GitHub Desktop.
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
const app = {}; | |
consign() | |
.include('api') | |
.into(app); | |
const flattened = flatten(app); | |
Object.entries(flattened).forEach(([route, router]) => { | |
const baseRoute = `/${route.replace(/\.controller$/, '').replace(/\./g, '/')}`; | |
server.use(baseRoute, router); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment