I am using fastify as a web framework in my nodejs project. I want to call all my routes from a directory having a base route defined in main JS file like we do in express. I have read many blogs but i did not find any relevant answer to my question
like in express we assign routes as-
app.use('/user', user_route)
and then in user_route we define all other routes method.
In fastify I have used
fastify.register(require('./routes/users'), { prefix: '/user' })
but then only one function can be called like-
module.exports = function (fastify, opts, done) {
fastify.get('/user', handler_v1)
done()
}
What if I want to call multiple route function?