This answer to a similar question does a great job at explaining how fastify-plugin works and what it does. After reading the explanation, I still have a question remaining; how is this different from a normal function call instead of using the .register() method? To clarify with an example, how are the two approaches below different from each other: Answer
Tag: fastify
Fastify: Ommit some APIs from using basic authentication
Currently, I have two APIs: /auth and /no-auth. I would like ONLY one of them to use basic-auth. I am using fastify-basic-auth plugin on top of fastify in node. /auth should require authentication. /no-auth should NOT require authentication. Currently, the way my code is set up, BOTH are requiring authentication. Answer To archive it you need to create a new