Skip to content

Instantly share code, notes, and snippets.

@tarang9211
Created December 11, 2020 04:26
Show Gist options
  • Save tarang9211/0a9848fd470383356a4be62980bc37ef to your computer and use it in GitHub Desktop.
Save tarang9211/0a9848fd470383356a4be62980bc37ef to your computer and use it in GitHub Desktop.
/** 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