Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Hello, question 0 for me about express.js: is there a simple way to map all the methods and fields of an objects to a route, with parameters where appropriate?
    1 reply
    I am thinking of writing something myself
    James Pickard
    @vincenzoml sure it's possible
    James Pickard
    @StephenLynx I can't speak for the Express team or on the matter you're discussing, but I can tell you that there's only a very small number of people working on Express at the moment, and most likely the website simply hasn't been updated for a long time
    Momoh Tyler
    is Express Open source?
    James Pickard
    Momoh Tyler
    ok, thank you.
    Ali Ahsan
    hello everyone , i am using oauth2.0 in my app and i want to allow only people with university account (want to allow only specific domain) to visit my app. Anyone knows how to do it ?
    Ronique Ricketts
    You may have to create a list of domains then use cors to whitelist those domains
    Dina Berry
    Naming conventions question: if I have an Express.js app using views and I want to separate out View routes from Apis routes, what is the naming convention for these two routes? I'm used to Apis having /api/ in the route, but is there a corresponding route for views?
    James Pickard
    @dougwilson announced Express 5.0 beta.1 yesterday! 6 years in the making...
    Vineet Dixit
    I'm wondering why does Express call router.param after router.use here?
    outer.param("logNumber", (req, res, next, value) => {
      console.log("1 Called at", Date.now());
    router.use((req, res, next) => {
      console.log("2 Called at", Date.now());
    Console output
    2 Called at 1645747636698
    1 Called at 1645747636707
    hi all
    i'm having trouble working out how to access query parameters in a POST endpoint
    no matter what I try, it yields an empty object
    James Pickard
    @dan-cotruta did you figure it out? What are you trying?
    Matthieu Napoli

    Hey @euoia & @dougwilson, I see that activity is picking up again on GitHub 🎉
    I'm a maintainer of Serverless Framework (https://github.com/serverless/serverless). We have more than 8,000 users/month deploying Express to AWS.
    We want to build first-class integration between Express and AWS, and make it extremely easy for Express users.

    We have some ideas we want to share with you, would you be interested to discuss it? Should we contact anyone else?

    Kal Sze
    I'm confused. Is the error handling middleware supposed to go before my routes or after my routes? The documentation isn't clear about this: https://expressjs.com/en/guide/error-handling.html
    Matt Voboril
    @ksze for errors thrown in code, the handler should be before routes. for a catch-all route to give a generic error, you'd want that after all the other routes.
    1 reply
    Douglas Wilson
    Hi @mnapoli yes, I would be certainly interested! You're welcome to share where ever you like, the issue tracker, here, or DM me directly if you want. Happy to hear the ideas around that and what changes could be made.
    1 reply
    Shreyash Pingle
    Hey I just joined this. This is for express framework right
    Hi all! I'm having some difficulty with default engine not being specified. I'm using React, so I'm using sendFile to send to a static bin file (some middleware). Do I still need to specify a default engine in my app.js file?
    Biswajit Sharma
    Hi guys, I am stuck in a place where I am performing http GET request when a button is clicked, as a response I am getting a html page as a response. I am not able to redirect to that html page. For example I am in home page i.e localhost:4000 and performed a GET request localhost:4000/login, here i am getting the login html page from the server but not able to redirect it.
    hi, app.set('etag', false) will set all the response status to 200, how to limit this to only a particular router, say routes/users.js
    How do I convert a torrent into a readable stream? I'm using NodeJS, Express (for a web server), and Browserify (for WebTorrent), but since WebTorrent only works for WebRTC I can't use WebTorrent.
    Seif Eddine Slimene
    @Eltik You can use Browserify
    Md. Touhidur Rahman
    This message was deleted
    This message was deleted
    I have a problem!!!
    Why this custom Payload too Large limitter not working?
    Can anybody say?
    // Limit, 3 MegaBytes
    // 1 << 10 = 1024 << 10 = 1024 * 1024
    const limit = 3 << 20;
    // Text Body Parser
    server.use(function (req, res, next) {
      let ln = req.get('content-length');
      if (ln && ln > limit) {
      req.body = '';
      let overLimit = false;
      req.on('data', chunk => {
        if (overLimit) return;
        req.body += chunk;
        if (req.body.length > limit) {
          overLimit = true;
      req.on('end', () => {
        if (!overLimit) next();
    Even if payload exceeds the limit, the request is still processed.
    Hello everyone, what db would you use if you had entries that you wanna lookup via location, like when you give your location info to the server and get back the locations sorted by closest to you, and does it make sense to keep the entries in express memory then to retrieve it with every call. because the entries will not change often?
    1 reply
    Robyn Drake
    I try and start the express server side of this basic web application and I get this error: TypeError: Router.use() requires a middleware function but got a string codes is at https://github.com/robindrake/starter-express-api the answers I'm finding, I've already done what was said.
    The "/" route works just fine
    I need to leave to wait for transport to dialysis in 15 minutes.
    Robyn Drake
    Oh well.
    Robyn Drake
    Lucas Marra
    Hello hello... anyone here using 'mongoose-unique-validator' uniqueValidator?
    Need help with error message...
    7 replies
    Kyle Anthony Williams
    I have a very silly question. Is it possible to embed a Node HTTP server within an Express app? :)
    you can tell express to use a static website with index.html or javascript, for example you could host an angular app within, i did not try it but why shouldn´t a node http server not work when set as static site
    Hagen DeRouen
    How do I service static files in my public directory that's not at the root. My directory is structured as follows:
    Vaibhav Arora
    app.use(express.static(path.join(__dirname, 'src', 'public'))); might work
    Hi, I'm new to ExpressJS and self-taught developer. I'm trying to browse about the difference between session https://www.npmjs.com/package/express-session vs session storage, but I don't find it yet. Anyone here wants to give me a bit about keywords or blog posts regarding that? Thank you! :)
    Ahoy! How usable is the 5.0 beta for a production app?