Skip to content

Microgateway server core, executes main port forwarding logic when fed config and plugins

License

Notifications You must be signed in to change notification settings

snyk-community/microgateway-core

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Microgateway-Core microgateway-core is a pass through api proxy that events to plugin middleware. The plugin middleware can implement a variety of functions like oauth, spikearrest, and quotas on your apis.

we have provided some default middleware that you can use in the microgateway-plugin repo.

##Usage to use microgateway-core you must initialize microgateway with a config. the config can be instantiated using the microgateway-config repo.

const config = require('microgateway-config');
config.init({source:'<somepath.to.a.yaml.file>');
const Gateway = require('microgateway-core');
const plugin = {
	init:(config,logging,stats)=>{
		return {
			onrequest:(req,res,[options],cb){
				cb();
			}
		}
	}
}
config.get({source:'same.yaml',keys:{tokenstoanapigegateway}},(err,config)=>{
	const gateway = Gateway(config);
	gateway.addplugin(plugin);
	gateway.start((server)=>{
	});
});

##more info for more info on usage we use the microgateway-core to power our microgateway product. we use a command line utility here. https://github.com/apigee/microgateway-cli

About

Microgateway server core, executes main port forwarding logic when fed config and plugins

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%