Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    vikram parihar
    static content not loading when i navigate to other route
    In home page http://localhost:3000/ static file like css loading perfacty but
    when i move http://localhost:3000/preview/modern to this url static files are not loading
    need help
    i have public folder in root dir and i have set up static code in express like this
    Ronique Ricketts
    @vikramparihar Ensure this is high up the hierarchy of your code. Also ensure your static files do have correct routing to corrospond with the endpoints you are hitting.
    vikram parihar
    @RoniqueRicketts it was a silly mistake my bro. But as you replyed. i saw again and did not fixes.
    thank you
    Ronique Ricketts
    Brayden Moon

    Hey guys, hows it going?

    I have a quick little question and i'm hoping that it will be a quick solution

    I am looking for where abouts in the request that the information for a multi-part/form data gets stored

    As i have built an express server that acts like an orchestrator and will pass on requests using node-fetch to other services in the eco-system.

    I am currently forwarding all the headers onto the node-fetch request, along with the method...

    but the final service (using multer) can't see the file that was in the original request

    This is what it kind of looks like:

    Website ----FILE---> Orchestrator ---- FORWARD REQUEST ----> Resulting service.

    The orchestrator sees the information and passes it onto the resulting service...
    Except resulting service isnt getting the files sent from the website. I feel it is because im not including the right part of the req object. Hence my question, of where the multi-part/form data is kept in the req object

    Arun Kumar
    Hi All
    I'm facing trouble accessing the req.body paramenters
    when I console.log the req.body it prints the body. But when I try to access the req.body.firstName it says undefined
    I'm using app.use(express.json());
    Brayden Moon
    @arunkumar413 Have you tried using body-parser instead?
    then in your route, try and doing something along the lines of :
    const {firstName} = req.body;
    @arunkumar413 let me know if that fixes anything :)
    Arun Kumar
    @bmoon-autoit I tried to access it like this req.body.firstName

    @arunkumar413 Have you tried using body-parser instead?

    It's a bit confusing which one to use body parser or express.json?

    Arun Kumar
    Also does the app.use(express.json()); allows us to access the body as js object?
    Brayden Moon
    @arunkumar413 I have only ever used body-parser. It just works all the time for me.
    It doesn't really matter if you use the code snippet i use, or the code snippet you use to access the data. Its just a nicer way of exploding the object imo.
    @arunkumar413 At the end of the day, if you can get it to work with express.json go for it, though everything i have ever done has been with body-parser... and everything I have ever read has always said to use body-parser instead of express.json
    Anshul Bartwal
    Hey guys how many of you are using the latest alpha version?
    Anyone have the current lead maintainer's email address? I tried to submit an issue and my issue was blocked.
    Douglas Christopher Wilson, can't find his email anywhere
    The current lead maintainer is Douglas Christopher Wilson
    Hello everyone, new to this community. Started using express a while back and thought of collaborating with the community. I just went through the Github repo and found that there are no beginner-friendly issues as of now. Any ideas on how should I get started?
    Douglas Wilson
    Hi @snowmac it is in the package: https://github.com/expressjs/express/blob/master/package.json#L9 . Sorry you ended up blocked; the default procedure to a security issue reported in the issue tracker is to reply in the issue and delete the contents. If the issue title contains sensitive information, the issue has to be deleted since github does not provide a method to remove the original title from the display. The moderation typically implements a short block to encourage reaching out with the correct procedure, as in the past the original user would just keep opening a new issue over and over with the same content or reposting it. I would encourage you to look at the security policy for any repo before reporting security issues in the future (under the "security" tab for any github repo).
    Hi everyone,
    Should I write a test case to check my application is listening to the correct port?
    Kal Sze
    What's the point of doing both?
      app.use((req, res, next) => {
        compression()(req, res, next);
    I have and nested object that i want the user to update through inputs but req.body only returns a 1 level nested array. How can i have req.body return the objects in the original form but the value supdated

    Is there any way to use a dynamic route with an app (or router) .use?

    router.use(`/:userid`, getHandler)

    When I do this, getHandler doesn't get req.params.userid.
    I could just get the url and manually interpret it, but it's a lot easier to use dynamic routes, and I just generally like not trying to do the work around way, seeing as there's usually more bugs when I try to do that. Thanks!

    Currently have a express.js API server setup with backend postgres. Setup using passport basic Auth. Now need to setup to use access token. Any recommendations on what tech to use?
    @yellow-net check out jwt + crypto
    @yosiasz been reading up a bit more. Understand the Oauth2 is the most secure?
    How is it possible to install a let's encrypt cert on express.js with port 3000. When running installer certbot looking at port 80 instead of 3000, even if I add :3000 to the URL?
    I have installed the cors package via nom and added the app. Added cors require and app.use(cors());. However when I test still says cors is not enabled?
    Kal Sze
    Does expressjs care about trailing / in routes?
    @yellow-net please share your code of how you enabled it
    see this also
    @ksze what prompts you to ask that question so we dont lead you to a hacky solution :smile: