Skip to content

Releases: BackendStack21/fast-gateway

Refactoring restana routes registration

13 Dec 13:12
Compare
Choose a tag to compare

Minor cleanup in regards to restana routes registration.

Support restana server factory

13 Dec 09:57
f6cfd1e
Compare
Choose a tag to compare

In this release we extend the gateway configuration related to restana, basically we are allowing to overwrite the restana instantiation inside the gateway by providing a factory method.

const gateway = require('fast-gateway')
const restana = require('restana')
const serverInstance = restana({})

const server = gateway({
  restana: () => serverInstance,
  //...
})

The goal is to allow more complex restana initialisations such as the Elastic APM support.

Adding timeouts and proxyHandler hook

17 Nov 23:00
Compare
Choose a tag to compare

Added

Timeouts and Unavailability

We can restrict requests timeouts globally or at service level using the timeout configuration.

You can also define endpoints specific timeout using the property timeout of the request object, normally inside a middleware:

req.timeout = 500 // define a 500ms timeout on a custom request.

NOTE: You might want to also check https://www.npmjs.com/package/middleware-if-unless

Circuit Breakers

By using the proxyHandler hook, developers can optionally intercept and modify the default gateway routing behavior right before the origin request is proxied to the remote service. Therefore, connecting advanced monitoring mechanisms like Circuit Breakers is rather simple.

Please see the demos/circuitbreaker.js example for more details using the opossum library.

Update dependencies

26 Oct 04:14
31d9bef
Compare
Choose a tag to compare
  "dependencies": {
    "fast-proxy": "^1.2.0",
   ...
    "restana": "^3.3.3",
   ...
  }

Updating restana and other dev deps

29 Sep 19:31
1288850
Compare
Choose a tag to compare
Merge pull request #10 from jkyberneees/update-deps

updating deps

Introduce global "targetOverride" config

12 Sep 15:06
Compare
Choose a tag to compare

Intended for testing and debugging purposes, the new targetOverride property allows to "debug" your remote gateway instance by ignoring all target values on the config.
This property is optional and should not be set on production.

Usage:

const service = gateway({
  targetOverride: 'https://yourdev.api-gateway.com'
  ...
  routes: [...]
})

Updating deps

27 Aug 19:51
Compare
Choose a tag to compare

Updating deps:

  • fast-proxy: ^1.1.3

GET /services.json

04 Aug 10:10
b1fcd77
Compare
Choose a tag to compare

Now the gateway exposes minimal documentation about registered services at: GET /services.json

Example output:

[  
   {  
      "prefix":"/public",
      "docs":{  
         "name":"Public Service",
         "endpoint":"/swagger.json",
         "type":"swagger"
      }
   },
   {  
      "prefix":"/admin"
   }
]

Updating deps

17 Jul 09:45
Compare
Choose a tag to compare
"restana": "^3.3.0"

Updating deps

16 Jul 07:47
Compare
Choose a tag to compare

"http-cache-middleware": "^1.2.3"