Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    I have updated my PR with a long standing issue and the test case is working.
    Claudio Teixeira
    Hello guys.
    Can you please let me know if the following endpoints are REST compliant?
    ok so my api randomly stopped working
    im using tyoescript and it gives me errors now
    Screen Shot 2021-10-09 at 2.02.43 PM.png
    I fixed it
    I created a folder called source in my project and moves tsconfig into that
    it fixed the errors
    Kal Sze
    Does Express have the ability to have a global, catch-all, exception handler that will just log the exception with traceback? Right now, my whole server crashes if an exception is raised in any of the route handlers and is not caught explicitly.
    Hey everyone. I'm pretty new to express, and I'm extremely baffled at why I every route except for the index route comes back as a 404. I had others but I removed them. I can't find any errors, and postman shows it's a normal 404 for any get, post, etc method. Anyone have any ideas? https://github.com/bcaylor10/scattergories-rooms-server/blob/master/routes/rooms.js
    Arthur Gritsishin
    Hello everybody! Sorry for my english, I am using a translator.
    Friends, I'm just learning, help me figure out the problem.
    There is a task to translate the text in some paragraphs of the PUG template.
    I am trying to pass to res.render (layout, {"year_of_birth_for_translate": "year of birth",} where year_of_birth_for_translate is the ID of the P item in the PUG template.
    As a result, nothing changes in the layout, it does not give errors either. Please help me figure out what I'm doing wrong? Thank you all for your help!
    Lorenzo Sandini
    Hello everyone, beginner question for starters. I am trying to write an api in order to use the astronomy-bundle package. So far, so good. I wrote a small node/express app serving static a static HTML file.
    My HTML file has a form posting a date to app.post route on my API, where the date is saved as a date.json file server-side. Then the node app should pick up the new date, pass it to the astronomy script computing planet coordinates, and save the new coordinates as a data.json file.
    I need the client to reload the HTML file to display the new coordinates next to the date, in the entry form.
    Lorenzo Sandini
    It works fine the first time after loading the app.js on my server, and when the client posts a new date, the date.json is written correctly and the coordinates written correctly also. But even when reloading the page on the client, the coordinates aren't updated. I need to reload the server app in order to see the updated corrdinates in my HTML page. Hot reloading the server doesn't sound like the right thinkg to do... Suggestions ?
    Hello, I'm trying to send a simple signal to a specific path for a heartbeat API, but I am new to express and don't really know how to use it.
    Every minute the "pulsing heartbeat" log will be sent, but the pulse itself will not.
    I also tried res.send(); but it didn't work.
    is it normal for a middleware you made to be called multiple times for one request?
    Instead of putting some request specific things into the request object, is it a good practice to store and access with the help of cls-hooked?
    It is a bit tedious to pass down eg. the logger to every little method.
    MERN Micro Framework

    Hello Everyone,

    MERN Micro Framework provides starter kits for building web, desktop and mobile apps in pure JavaScript.


    If you have any query or suggestions. Please let me know.

    Hello I am learning web dev and I am creating a very simple app using express and handlebars. I am having troubles to serve static files when I use routers
    my code looks like this:
    app.use(express.static(path.join(__dirname, 'static')))
    after which I connect the router
    app.use('/users', usersRouter)
    If i serve files from my main file index.js I get all the static content. However, if i open any page under the '/users/' path I get no static content. Moreover, if I open the browser console I get this error message
    The resource from “http://localhost:3000/users/css/style.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
    why is the '/users' being added to my link and why is this happening?
    Jamund Ferguson
    @eitanbronschtein how are you referencing your CSS in your HTML? It may need to be /css/style.css instead of css/style.css. Without the initial / it will be relative to the current path /users in that case
    Hello, how can I get just raw request body without any parsing?
    seems using express.raw() as body parser middleware works
    Hello, Im curious to know when we increase the parsing limit for a request body to avoid payload issue (100kb default to 10mb) will it impact on performance if so how much?
    Tom Cruickshank
    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
    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

    @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
    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
    Happy new year everyone!
    James Pickard
    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
    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
    I will work on a pull request for this issue expressjs/expressjs.com#1313
    Nicolás Fantone
    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