Route logic
module.exports= {
resources:{
dogs:{
get:{
// notice that could be an async function, and the use of the spread operator
do: async ({req, res, next, db, user, resources})=>{
// custom logic here
return next() // ensure to throw an error or call next, like a normal express middleware
}
}
}
}
}Last updated
Was this helpful?