Skip to content

Commit c90a25b

Browse files
authored
fix: update restana methods API compatibility (#103)
* fix: update restana methods API compatibility The newer version of restana changed its export structure. The require('restana/libs/methods') now returns a function with a .BASE property containing the HTTP methods array, rather than directly exporting the array. Fixes test failures with: TypeError: require(...).filter is not a function * chore: bump version to 5.0.0
1 parent bd0cca3 commit c90a25b

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const defaultProxyFactory = require('./lib/proxy-factory')
66
const restana = require('restana')
77
const defaultProxyHandler = (req, res, url, proxy, proxyOpts) =>
88
proxy(req, res, url, proxyOpts)
9-
const DEFAULT_METHODS = require('restana/libs/methods').filter(
9+
const DEFAULT_METHODS = require('restana/libs/methods').BASE.filter(
1010
(method) => method !== 'all'
1111
)
1212
const NOOP = (req, res) => {}

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fast-gateway",
3-
"version": "4.2.0",
3+
"version": "5.0.0",
44
"description": "A Node.js API Gateway for the masses!",
55
"main": "index.js",
66
"types": "index.d.ts",
@@ -31,7 +31,7 @@
3131
"fast-proxy-lite": "^1.1.2",
3232
"http-cache-middleware": "^1.4.1",
3333
"micromatch": "^4.0.8",
34-
"restana": "^5.0.0",
34+
"restana": "^6.0.0",
3535
"stream-to-array": "^2.3.0"
3636
},
3737
"files": [
@@ -42,26 +42,26 @@
4242
"LICENSE"
4343
],
4444
"devDependencies": {
45-
"@types/node": "^22.13.11",
46-
"@types/express": "^5.0.0",
47-
"artillery": "^2.0.21",
48-
"aws-sdk": "^2.1691.0",
49-
"chai": "^4.5.0",
45+
"@types/node": "^25.7.0",
46+
"@types/express": "^5.0.6",
47+
"artillery": "^2.0.31",
48+
"aws-sdk": "^2.1693.0",
49+
"chai": "^6.2.2",
5050
"consistent-hash": "^1.2.2",
51-
"cors": "^2.8.5",
52-
"express": "^5.0.1",
53-
"express-jwt": "^7.7.8",
54-
"express-rate-limit": "^6.11.2",
51+
"cors": "^2.8.6",
52+
"express": "^5.2.1",
53+
"express-jwt": "^8.5.1",
54+
"express-rate-limit": "^8.5.1",
5555
"faye-websocket": "^0.11.4",
5656
"fg-multiple-hooks": "^1.3.0",
57-
"helmet": "^7.2.0",
57+
"helmet": "^8.1.0",
5858
"http-lambda-proxy": "^1.1.4",
5959
"load-balancers": "^1.3.52",
60-
"mocha": "^10.8.2",
61-
"nyc": "^17.1.0",
60+
"mocha": "^11.7.5",
61+
"nyc": "^18.0.0",
6262
"pem": "^1.14.8",
6363
"request-ip": "^3.3.0",
64-
"response-time": "^2.3.3",
65-
"supertest": "^7.0.0"
64+
"response-time": "^2.3.4",
65+
"supertest": "^7.2.2"
6666
}
67-
}
67+
}

0 commit comments

Comments
 (0)