Hello. As of release 5.0.0 of expressjs, a change in pattern styling via the path-to-regexp package has broken wildcard Express.js routing paths. As a consequence of this, the default pathRegex property within fast-gateway now appears to be broken. Routes that do not provide an explicit pathRegex property (e.g., a route named /api, which would have a generated path of /api/*) produce the error described within the following thread and cause applications utilizing fast-gateway to error out:
expressjs/express#5936 (comment)
Notably, updating the opts object's pathRegex property from /* to /*regex within the fast-gateway source code appears to fix this, but truthfully, I am not confident that this is the "intended" solution per the Express thread linked above -- or else I would have submitted this as a PR :) Please advise! We've been using fast-gateway for years and it's been great for our use case.
opts = Object.assign({
middlewares: [],
pathRegex: '/*regex'
}, opts)
To Reproduce
- Initialize a bare npm repository
npm i express@^5.0.0
npm i fast-gateway
- Run the following snippet of code:
const gateway = require("fast-gateway");
const express = require("express");
const app = express();
const routes = [
{
prefix: "/api",
target: "http://localhost:1111",
},
];
const server = gateway({ routes, server: app });
server.listen(1234, () => {
console.log(`\nGateway communication started on port 1234.`);
});
This will produce the error attached in the Screenshots section below.
Expected behavior
The console.log call will be produced within the relevant terminal. Speaking more broadly, wildcard prefixes should continue to work without issue.
Screenshots
Error produced:

Hello. As of release
5.0.0ofexpressjs, a change in pattern styling via thepath-to-regexppackage has broken wildcard Express.js routing paths. As a consequence of this, the defaultpathRegexproperty withinfast-gatewaynow appears to be broken. Routes that do not provide an explicitpathRegexproperty (e.g., a route named/api, which would have a generated path of/api/*) produce the error described within the following thread and cause applications utilizing fast-gateway to error out:expressjs/express#5936 (comment)
Notably, updating the
optsobject'spathRegexproperty from/*to/*regexwithin thefast-gatewaysource code appears to fix this, but truthfully, I am not confident that this is the "intended" solution per the Express thread linked above -- or else I would have submitted this as a PR :) Please advise! We've been usingfast-gatewayfor years and it's been great for our use case.To Reproduce
npm i express@^5.0.0npm i fast-gatewayThis will produce the error attached in the Screenshots section below.
Expected behavior
The
console.logcall will be produced within the relevant terminal. Speaking more broadly, wildcard prefixes should continue to work without issue.Screenshots

Error produced: