ExpressGateway / express-gateway

A microservices API Gateway built on top of Express.js
https://www.express-gateway.io
Apache License 2.0
2.97k stars 347 forks source link

Policy Creation #974

Closed neerajnegidev closed 4 years ago

neerajnegidev commented 4 years ago

is there any way to create own policy and put it source code inside root directory e.g. inside express-gateway/policy? How to register policy from root location of project. As per documentation it will be done through manifest.js init function, but i am not able to see manifest.js file anywhere.

MohammadWasi commented 4 years ago

@neerajnegidev you need a plugin for that. for more information please go to this link- https://www.express-gateway.io/docs/plugins/plugin-development/#example-plugin-package-overview

code-angels commented 4 years ago

I'm a bit confused about this. Does this imply that it is not possible to apply a policy as custom middleware ( like you would with a regular Express application) without explicitly writing an external plugin and registering it?

Edit: Never mind, found the answer here: https://www.express-gateway.io/docs/plugins/

The plugin framework enables anyone to take Express middleware and integrate them into Express Gateway as plugins. Express Gateway provides a declarative way to take advantage of Express middleware to be driven centrally and executed dynamically.