meteor-restivus
meteor-restivus copied to clipboard
Middlewares ?
Hi Kahmali,
Is there a way to add a middleware to my endpoints? I need this because I have a custom auth system based in API-Keys where in every call to an endpoint, the API-Key must be sent, and (in server side) before perform the endpoint logic, check if is a valid key and check the key's quota I found myself repeating over and over the same call to that function, so I will be nice if i can add it like a middleware
Take a look at how we have accomplished this within Rocket.Chat: https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-api/server/api.js