DEV Community

Al Tsang
Al Tsang

Posted on

New Plugins, New Release - Say Hello to Express Gateway 1.2.0!

Since the official launch in July at the San Francisco Node.js Summit, we've been hard at work with Express Gateway, an open source API Gateway built entirely on Express.js. It's not just us over here at LunchBadger. We've seen some pretty interesting feedback from the developer community already. So, we're excited to pump up the jam on this and start burning down that backlog from the Community Roadmap.

Now, that you've got the gist of it - our latest release (also broadcasted over Product Hunt) includes an extensible Plugin Framework.

What the hell is this Plugin Framework?

The Plugin Framework enables developers to take Express middleware and integrate them into Express Gateway as plugins.

Express Gateway plugins contain entities and also allow event subscription. SO, one way to kung fu the crap out of that is to think of a plugin as a container of Express Gateway entities. They extend the core by adding entities and providing event handlers.

What does that mean for Express Gateway?

So, Express Gateway 1.2.0 adds a new plugin engine that allows anyone to add their own extension entities within a plugin. Then you can install and utilize it dynamically within Express Gateway.
An Express Gateway plugin acts as a container and has three key things:

  • Package.json
  • A folder for each entity extension
  • Manifest.js

The package.json declares all dependencies that the plugin requires, just like any Node modules.

We got to work breaking down all of the installation, entity extension point folders, manifest.js, and more of that magic.

Curious to Build Your Own?

Express Gateway is a thin layer on top of ExpressJS Node.JS framework and uses a lot of concepts from it. So it is good to have some idea of it, especially Express.js Middleware.

To understand when different parts of plugin are registered and loaded check out the Express Gateway Boot Sequence explanation.

Here's the short version:

  • Initial Phase (Config Loading,Plugin registration)
  • Express Gateway Initialization (Gateway ExpressJS server initialize, Loading extensions for Gateway, Pipeline engine initialization, Gateway Server start, Events)
  • Admin API initialization

~Fin

You can also check out more extension points covered in the Development Guide, or build custom policies. Here is an Example Plugin on Github with all of those awesome extension points being utilized.

Before it's over, if you'd like to go check out the latest release on Product Hunt and share your thoughts on the project, new release.

Top comments (0)