Created
May 21, 2018 02:51
-
-
Save maisonm/1f94e40381bcee47ce2d2a094a292054 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 fs = require('fs'); | |
const path = require('path'); | |
module.exports = (app) => { | |
fs.readdirSync('routes/api/').forEach((file) => { | |
require(`./api/${file.substr(0, file.indexOf('.'))}`)(app); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment