meteor-restivus icon indicating copy to clipboard operation
meteor-restivus copied to clipboard

Middlewares ?

Open santiq opened this issue 8 years ago • 1 comments

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

santiq avatar Sep 06 '16 14:09 santiq

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

graywolf336 avatar Apr 25 '17 17:04 graywolf336