Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ghost
    @ghost~5c363bf4d73408ce4fb42605
    but not sure what your business case/requirements is that it requires xhr
    Alfredo Severo
    @portal7
    and I'll let you know how it was
    is not necessarily a requirement, just to mimic the original response that I try to replay
    after all, the content is the same.
    Ghost
    @ghost~5c363bf4d73408ce4fb42605
    :soccer:
    Alfredo Severo
    @portal7
    changed functions to async and implemented with await, but chromes still showing response type as Document
    Ghost
    @ghost~5c363bf4d73408ce4fb42605
    Are you still doing res.json?
    you need to read some more. https://expressjs.com/en/api.html#req.xhr
    just changing the functions to async is obviously not enough
    Santiago Miranda
    @santimirandarp
    Hi there...I've created an app with express-generator
    one of the root files is app.js, but there is also site.js
    but that file is almost empty...it's a file contemplating x509 certificates etc, any idea why it's there?
    Christian Garrovillo
    @cgarrovillo
    How does Express handle subprocesses? Would I cause any issues with the framework if I used the Node.JS modules directly?
    Wilbert Comicho
    @wcomicho_gitlab
    Hi,
    Anyone here tried IIS and NodeJS express with url rewrite? My problem is that the URL Rewrite is re-writing sites that are suppose to be redirected outside my local app.
    Suppose to be like this: res.redirect("external.com/somepath") but its returning "internal.com/somepath".
    da-source
    @da-source

    I'm passing a variable to my template renderer in ExpressJs like so:

    index.js
    app.get('/simple_view/', function(req, res, next){
    title='A TITLE';
    res.render('simple', {
    title: title
    });
    });
    I would like to access the title variable in a JS script on my template page, but I'm getting Uncaught ReferenceError: title is not defined error.

    simple,pug
    script.
    console.log(title);
    How can I solve this?

    Elle Burgess
    @develleoper
    does anybody know if 5.0 is ever slated for release? there's tracker issues claiming a series of "summer of this year" and "end of this year" estimates since 2019
    and i just really want to stop having to worry about manual async error handling 😥
    Caleb David
    @microworlds
    Hello all! :raised_hands: I am a noob. Are there any frameworks/resources for building Chrome extensions with Vue js using the latest Chrome manifest_version: 3? Thanks in advance. This framework: https://github.com/Kocal/vue-web-extension seems unmaintained and does not support manifest v3
    verlainek83
    @verlainek83

    hi everybody, i have this bug whan i want to start my app: Too many tables; MySQL can only use 61 tables in a join

    SequelizeDatabaseError: Too many tables; MySQL can only use 61 tables in a join
    at Query.formatError (/home/elodie/tfe/placetopark/node_modules/sequelize/lib/dialects/mysql/query.js:265:16)
    at Query.run (/home/elodie/tfe/placetopark/node_modules/sequelize/lib/dialects/mysql/query.js:77:18)
    at processTicksAndRejections (internal/process/task_queues.js:97:5).

    verlainek83
    @verlainek83
    my app work with expressjs sequelize and MySql
    Ghost
    @ghost~5c363bf4d73408ce4fb42605
    Do you really need to join to 61 tables? Most unsual
    verlainek83
    @verlainek83
    i have join 13 tables and after that the error occurs
    in my class diagram i have 15 tables, but for start running the app i create 13 tables
    i don't know why i have this error
    Kal Sze
    @ksze
    Can somebody explain to me how I fix this CORS-related error that I see in Firefox? "Reason: header ‘access-control-allow-origin’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response"
    1 reply
    I'm using expressjs and its cors middleware.
    I have already added this before any of my routes in my server code:
    app.use(cors({
          methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
          origin: [myOrigin1, myOrigin2],
          allowedHeaders: ['Access-Control-Allow-Origin'],
    }));
    Kal Sze
    @ksze
    Or how can I make morgan log every request header that it receives? I'm not suspecting that something between my backend and the frontend is mangling the requests.
    e.g. the reverse proxy/load balancer/api gateway
    Levi Richardson
    @lerichardson
    Hi, I'm having a weird issue, wondering if someone could help me out
    Ghost
    @ghost~5c363bf4d73408ce4fb42605
    Would you like to tell us about it? We are at edge of our seats
    Zircoz
    @Zircoz
    lol
    WORMSS
    @WORMSS
    I feel ashamed a Richardson would ask to ask a question. (oh, I forgot my name on here is WORMSS and not my real name.. I am also a Richardson)
    Joe Pea
    @trusktr
    Anyone know how to make express.static serve symlinked files?
    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