const app = fastify()
const myAuth = (req, next) => {
if (req.path.id === "test") throw new Error('nope')
next()
}
app.get('/users/:id/', myAuth, ({path}) => ({ id: path.id }))
const app = fastify()
const myAuth = (req, next) => {
if (req.path.id === "test") throw new Error('nope')
next()
}
app.get('/users/:id/', myAuth, ({path}) => ({ id: path.id }))