Anyone know what is the request and response handler type in fastify?
Now I am just using 'any', typescript eslint gave me a warning:
fastify.post('/ac', async(req: any , res: any) => {
Anyone know what is the request and response handler type in fastify?
Now I am just using 'any', typescript eslint gave me a warning:
fastify.post('/ac', async(req: any , res: any) => {
The appropriate types you're looking for are "FastifyRequest" and "FastifyReply", respectively.
They can be imported and implemented as shown below.
import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
fastify.post('/ac', async (req: FastifyRequest, res: FastifyReply) => {
});