You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But that seems very strange to me, because you are reregistering the routes on every request. And because people use Fastify for its performance, it seems odd that the docs do not mention anything.
I have now solved it like this
letfastifyApp: FastifyInstance|null=null;asyncfunctioninitializeFastify(){if(fastifyApp)returnfastifyApp;constfastify=Fastify({logger: envToLogger[environment]??true,});fastify.addContentTypeParser("application/json",{},(req,body,done)=>{// @ts-expect-error payload is not typedreq.rawBody=payload.rawBody;// Useful if need to compute HMAC// @ts-expect-error body is not typeddone(null,body.body);});awaitregisterRoutes(fastify);awaitfastify.ready();fastifyApp=fastify;returnfastifyApp;}
Is Fastify so efficient in initializing that this omission is ok in the documentation? It seems very confusing for people like me who are not very familiar with Fastify..
The text was updated successfully, but these errors were encountered:
The docs mention that you can integrate fastify like this:
But that seems very strange to me, because you are reregistering the routes on every request. And because people use Fastify for its performance, it seems odd that the docs do not mention anything.
I have now solved it like this
Is Fastify so efficient in initializing that this omission is ok in the documentation? It seems very confusing for people like me who are not very familiar with Fastify..
The text was updated successfully, but these errors were encountered: