fast-gateway
Advanced tools
Comparing version 3.1.0 to 3.1.1
17
index.js
@@ -38,6 +38,15 @@ 'use strict' | ||
// processing websocket routes | ||
registerWebSocketRoutes({ | ||
routes: opts.routes.filter(route => route.proxyType === 'websocket'), | ||
server: router.getServer() | ||
}) | ||
const wsRoutes = opts.routes.filter(route => route.proxyType === 'websocket') | ||
if (wsRoutes.length) { | ||
if (typeof router.getServer !== 'function') { | ||
throw new Error( | ||
'Unable to retrieve the HTTP server instance. ' + | ||
'If you are not using restana, make sure to provide an "app.getServer()" alternative method!' | ||
) | ||
} | ||
registerWebSocketRoutes({ | ||
routes: wsRoutes, | ||
server: router.getServer() | ||
}) | ||
} | ||
@@ -44,0 +53,0 @@ // processing non-websocket routes |
'use strict' | ||
const WebSocket = require('faye-websocket') | ||
const { onOpenNoOp } = require('./default-hooks').websocket | ||
module.exports = (config) => { | ||
const WebSocket = require('faye-websocket') | ||
const { routes, server } = config | ||
@@ -8,0 +9,0 @@ |
{ | ||
"name": "fast-gateway", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "A Node.js API Gateway for the masses!", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,4 +6,6 @@ # fast-gateway | ||
A super fast, framework agnostic Node.js API Gateway for the masses ❤️ | ||
> Since v2.3.0, [AWS Lambda](https://www.youtube.com/watch?v=EBSdyoO3goc) proxying integration is supported via [`http-lambda-proxy`](https://www.npmjs.com/package/http-lambda-proxy) 🔥 | ||
> Since v2.3.0, [AWS Lambda](https://www.youtube.com/watch?v=EBSdyoO3goc) proxying integration is supported via [`http-lambda-proxy`](https://www.npmjs.com/package/http-lambda-proxy) 🔥 | ||
> Since v3.1.0, WebSockets proxying is supported via [`faye-websocket`](https://www.npmjs.com/package/faye-websocket) 🔥 | ||
## Medium articles: | ||
@@ -10,0 +12,0 @@ - https://itnext.io/a-js-api-gateway-for-the-masses-a12fdb9e961c |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28113
316
453