kahmali / meteor-restivus

REST APIs for the Best of Us! - A Meteor 0.9+ package for building REST APIs https://atmospherejs.com/nimble/restivus
MIT License
544 stars 117 forks source link

Middlewares ? #239

Open santiq opened 8 years ago

santiq commented 8 years ago

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

graywolf336 commented 7 years ago

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