Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Tom Cruickshank
    @tomvisions
    Hello, I'm interested in using a MVC for express for building a REST API. Would anyone recommend a good documentation to learn more how to do it?
    James Pickard
    @euoia:matrix.org
    [m]
    Hey all, has anyone looked at spinning each request off into it's own VM so you can use console.log anywhere in your app and have it prefixed with a unique request identifier?
    Or is that a crazy idea?
    Jacob B. Sanders
    @Segmentational

    @tomvisions, you can find quite a few examples on the official docs example page: https://expressjs.com/en/starter/examples.html

    Additionally, mozilla has a fairly extensive tutorial on views and mvc-related contexts here: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/routes

    James Pickard
    @euoia:matrix.org
    [m]
    I recall reading an issue where @dougwilson said he was really trying to get Express 5.0 released before the end of the year... does anyone know how that's going?
    I am asking in case there's anything I can help with
    James Pickard
    @euoia
    Happy new year everyone!
    James Pickard
    @euoia
    I would like to do a write up on the status of Express, a bit of history, and the challenges with releasing 5.0 - would anyone be interested in reading that?
    James Pickard
    @euoia
    I am curious, is there some other chat room for Express, because for a library 12.5 million downloads per week, this room doesn't seem very active
    James Pickard
    @euoia
    I will work on a pull request for this issue expressjs/expressjs.com#1313
    Nicolás Fantone
    @nfantone
    for all of you wondering about the state of the project and when/if 5.0 is landing: at this point in time, sadly, there seems to be more people willing to help than actual progress being put forward Express 5.0
    to my knowledge, there's only one outstanding (major) issue that needs to be addressed before moving out of alpha: pillarjs/router#102
    I have worked on it and, IMHO, it should be ready for merging - unfortunately, effort seems to have died out due to lack of communication/time from maintainers
    Nicolás Fantone
    @nfantone
    if anyone wants to contribute and give a hand, a very simple way would be to show support and participate on that issue
    Douglas Wilson
    @dougwilson
    Hi @euoia I ended up going to the emergency room right befire Christmas and so was unable to get the 5.0 beta released, but I did get a 4.x patch. I have received 4 security vulnerability reports in the interim and will need to triage / address / make some additional 4.x releases as soon as I am discharged before I can resume 5.x work. I hope that answers your question. Let me know if you would like any further information and happy new year everyone. Sorry for the set back and I think we can get 5.0 released before the end of January, as there is almost nothing left there. I pushed some more commits to the 5.0 branch but just didn't get to cut a new release off it yet.
    Nicolás Fantone
    @nfantone
    hey @dougwilson, many thanks for the update and very sorry to hear about your personal situation; hope you're feeling much better now! With regards to the vulns: would there be someone else that could be taking a look at those in the meantime? I'm up for it, if you need a hand.
    James Pickard
    @euoia
    Hi @dougwilson, I really appreciate the update. When I was looking through the GitHub issues again I saw your comment about recovering from sickness, and I'm sorry to hear you've been unwell again. I am going to see if I can get a pull request together for expressjs/expressjs.com#1313 and would also be happy to look at security issues if it's of any help. I will read through pillarjs/router#102 and see if there's anything I can contribute there.
    James Pickard
    @euoia
    I've read through the pillarjs/router#102 issue - should I have a stab at updating the migration guide to mention these changes? https://github.com/expressjs/expressjs.com/blob/gh-pages/en/guide/migrating-5.md
    Nicolás Fantone
    @nfantone
    I think that'd be nice
    James Pickard
    @euoia
    Ok, will do
    I'm just looking at the description of callback functions here
    Is there a reason the documentation doesn't use the term "request handler" or something like that? If you define a callback without a next parameter, is it still considered a middleware?
    All the examples in the middleware callback function examples have the next parameter https://expressjs.com/en/5x/api.html#middleware-callback-function-examples
    James Pickard
    @euoia
    I think things would be clearer if handler functions were described as distinct from middleware
    The distinction being that middleware must call next, and the handler function must come last
    Nicolás Fantone
    @nfantone
    I don't know that there's an "official stance" on this, but I personally have used them interchangeably in the past
    James Pickard
    @euoia
    Ok, I will have a go at rewording it as part of this PR and perhaps we can discuss from there
    Nicolás Fantone
    @nfantone
    I mean, what would you call a handler that may call next on a given path, but not on others? I think it's rather subjective
    James Pickard
    @euoia
    Maybe I'd consider calling anything that sometimes calls next a middleware
    Nicolás Fantone
    @nfantone
    that might make sense, sure - in a more broad sense, I would call anything that takes in x and is expected to do something with it an "x handler"
    error handler, event handler, request handler, etc.
    James Pickard
    @euoia
    Maybe the docs should be clearer that a callback is expected to either 1) send a response, or 2) call next()?
    Would you say that's accurate?
    1 reply
    James Pickard
    @euoia
    James Pickard
    @euoia
    I created a pull request to update the documentation around async callbacks / middleware / request handlers
    James Pickard
    @euoia
    @nfantone I am just trying to understand the updated path-to-regexp documentation https://github.com/pillarjs/router/blob/27ca41b4aa9fce28948b96addbb8d8b67698dfa9/HISTORY.md
    Where it says "would match" or "would result" does that mean it used to but no longer does?
    1 reply
    In terms of impact on Express, for migrating Express from 4 to 5, I need to look at changes between n path-to-regexp 3.2.0 and 6.2.0, is that right (I'm basing that on the change to package.json in https://github.com/pillarjs/router/pull/102/files)
    1 reply
    James Pickard
    @euoia
    I guess I just need to copy those 4 bullet points, perhaps reword them to make them more Express-oriented
    James Pickard
    @euoia
    Ok @nfantone pull request created in the documentation repo expressjs/expressjs.com#1316
    James Pickard
    @euoia
    I reckon we should probably remove references to Express 3 in the v5 migration, I can't imagine it's very relevant to many people
    1 reply
    The app.router object, which was removed in Express 4, has made a comeback in Express 5. In the new version, this object is a just a reference to the base Express router, unlike in Express 3, where an app had to explicitly load it.
    James Pickard
    @euoia
    @nfantone @dougwilson are you aware of anything else I could help with?
    Nicolás Fantone
    @nfantone
    Nicolás Fantone
    @nfantone
    @euoia also reviewed expressjs/expressjs.com#1315
    James Pickard
    @euoia
    @iron2414mw did you figure it out?
    Norbert Varjasi
    @iron2414mw
    @euoia I did, took me sometime tho. The trick was to remove objects from the router stack, filtering them by path. Then it's gone, and I can even declare it again, if I want
    James Pickard
    @euoia
    ah right, interesting