Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Joe Pea
    @trusktr
    When a file is a symlink, it doesn't work.
    Ghost
    @ghost~5c363bf4d73408ce4fb42605
    Never met a Richardson I never liked
    @trusktr what kins of file
    carcleo
    @carcleo

    Hey everyone
    I am getting the follow error:

    Error: No default engine was specified and no extension was provided.

    Its my code:

    const express = require('express')
    const handlebars = require("express-handlebars")
    const router = express.Router()
    const app = express()
    app.engine("handlebars", handlebars({defaultLayout : "main"}))
    app.set("view engine", "handlebars")
    app.set('views',"../app/mvc/views")
    app.use(express.urlencoded({extended: true}))
    app.use(express.json())

    router.get('/', (req, res) => {
    res.render("home/home")
    })

    module.exports = router

    How i can resolve it?

    Thank U to who can help-me

    Jacob Schmidt
    @innovativestudios_gitlab
    Is there a way in which one could pass an array of res from a single req? I.E. router.get('/forum', { showCategories, showTopics, showThreads });
    rashid.nk
    @rashid-naico_gitlab
    hello room
    rashid.nk
    @rashid-naico_gitlab

    I'm working on an existing project.

    a GET request sent to express api, there is no body or any parameter
    but in api console.log prints a req.user object

    //UI request  : 
    myapp/api/user/getUsersTransactions 
    
    //route
    user.route('/getUsersTransactions')
      .get(userController.getUsersTransactions);
    
    //controller
    exports.getUsersTransactions= async (req, res, next) => {
      console.log(req.user, 'user')
    can someone help me to understand, where does object req.user come from ?
    Seif Eddine Slimene
    @SeifESlimene
    @rashid-naico_gitlab Use debugger statement and see the call stack.
    David Anderson
    @yowzadave

    I'm (trying to) use a vhost to serve static assets from a subdomain of my api, i.e.:
    api: demo.local.io
    static assets: assets.demo.local.io

    Just as a test case, I've set up a vhost something like the following:

    const assets = express();
    assets.get('*', (req, res) => {
      console.log('route reached');
      res.send('<html><body>Hello world</body></html>');
    }
    
    app.use(vhost('assets.demo.local.io', assets));
    It seems that my route is successfully being reached—my server logs the above statement—but the response is never sent, and a route that is defined subsequently on the app express instance is reached instead.
    Any ideas what might be going wrong? I would have guessed that the later route should never be reached once the res.send() is called, but that seems not to be the case
    David Anderson
    @yowzadave
    The route that is being hit is my authentication route
    Santhosh
    @santhosh_qwk_gitlab
    How can I get the raw body from the request?
    Santhosh
    @santhosh_qwk_gitlab
    Simon Bailey
    @thebailers
    Hey all, is it possible to access req.query on POST routes? Seems to be working fine for GET but undefined for POST
    Infinite-3D
    @Infinite-3D
    how would i get the ip of an express server?
    the server is set up like this:
    const app = express();
    const server = app.listen(port);
    I can't get TS to be happy with wraping res.write at all
    tim.rohrer
    @tim-rohrer
    This channel doesn’t seem very active. Is irc used more?
    FOLASAYO SAMUEL OLAYEMI
    @Folasayo-Samuel
    Hello
    MERN Micro Framework
    @mernjs

    Hello Everyone, MERN Stack Boilerplate provides starter kits for building web, desktop and mobile apps in pure JavaScript.

    https://www.npmjs.com/package/create-mernjs-app

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

    prkeshri
    @prkeshri
    Hello
    I have updated my PR with a long standing issue and the test case is working.
    Claudio Teixeira
    @claudiotx7_twitter
    Hello guys.
    Can you please let me know if the following endpoints are REST compliant?
    /api/clients/{clientId}/drafts/confirm
    /api/clients/{clientId}/drafts/delete
    chargde_porcupine
    @Chargde-Porcupine
    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
    @ksze
    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.
    bcaylor10
    @bcaylor10
    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
    @ArthurGritsishin
    image.png
    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
    @lsandini
    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
    @lsandini
    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 ?
    Thegameinglemon10
    @Thegameinglemon10
    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.
    image.png
    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.
    nh916
    @nh916
    is it normal for a middleware you made to be called multiple times for one request?
    pihentagy
    @pihentagy
    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
    @mernjs

    Hello Everyone,

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

    https://www.npmjs.com/package/create-mernjs-app

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