Restricting Access to Path Parameter in HttpApi Middleware
With the new HttpApi, what's the easiest way of restricting access to a specific path parameter in a middleware?
i.e.
i.e.
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 }))