Skip to content

Instantly share code, notes, and snippets.

@catalinpit
Created May 26, 2021 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catalinpit/c865810e9a5c4d2261e1fa3133bd143b to your computer and use it in GitHub Desktop.
Save catalinpit/c865810e9a5c4d2261e1fa3133bd143b to your computer and use it in GitHub Desktop.
src/routes/routes.js
const controller = require('../controllers/controllers');
async function routes(app, opts) {
app.route({
method: 'GET',
url: '/job/applications',
handler: controller.getAllApplications
});
app.route({
method: 'GET',
url: '/job/applications/:id',
handler: controller.getApplication
});
app.route({
method: 'GET',
url: '/job/applications/filter',
handler: controller.filterApplications
});
app.route({
method: 'POST',
url: '/job/applications',
handler: controller.addApplication
});
app.route({
method: 'PATCH',
url: '/job/applications/:id',
handler: controller.updateApplication
});
};
module.exports = routes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment