Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with setting Express options #2629

Closed
cciocov opened this issue May 7, 2022 · 0 comments · Fixed by #2655
Closed

Issue with setting Express options #2629

cciocov opened this issue May 7, 2022 · 0 comments · Fixed by #2655

Comments

@cciocov
Copy link
Contributor

cciocov commented May 7, 2022

Up until 5.0.0-pre.15 I was able to use something like this:

const app = express(feathers());
app.set('query parser', function customQueryParser(str) { ... });

After 5.0.0-pre.15 this is no longer possible and I tracked the issue to the fact that we call .use() on the express app during the express(feathers()) call, which forces Express to initialise its lazy router (and at this point the query parser setting has its default extended value. The code I'm talking about is:

  app.use((req, _res, next) => {
    req.feathers = { ...req.feathers, provider: 'rest' };
    return next();
  });

(starting on line 109 in packages/express/src/index.ts).

Previously (i.e.: up to 5.0.0-pre.15) this code used to be packages/express/src/rest.ts and would only execute on app.configure(express.rest()).

I would suggest we keep express(feathers()) as similar as possible (in terms of the effects on the Express app) as the original express() call that people use to create a plain Express app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant