Skip to content

Instantly share code, notes, and snippets.

@catalinpit
Created May 26, 2021 13:09
Embed
What would you like to do?
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