Skip to content

Instantly share code, notes, and snippets.

@tarang9211

tarang9211/routes.js

Created Dec 11, 2020
Embed
What would you like to do?
/** routes/branches/index.js */
module.exports = function() {
router.get()
router.post()
}
/** routes/index.js */
module.exports = function() {
require('./branches')
}
// server.js
const routes = require('./routes');
app.use('/api', routes)
/**
With this strucutre, trying to consume api/branches doesn't seem to hit the route.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment