Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    but not sure what your business case/requirements is that it requires xhr
    Alfredo Severo
    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.
    Alfredo Severo
    changed functions to async and implemented with await, but chromes still showing response type as Document
    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
    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
    How does Express handle subprocesses? Would I cause any issues with the framework if I used the Node.JS modules directly?
    Wilbert Comicho
    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".

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

    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.

    How can I solve this?

    Elle Burgess
    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
    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

    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).

    my app work with expressjs sequelize and MySql
    Do you really need to join to 61 tables? Most unsual
    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
    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:
          origin: [myOrigin1, myOrigin2],
          allowedHeaders: ['Access-Control-Allow-Origin'],
    Kal Sze
    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
    Hi, I'm having a weird issue, wondering if someone could help me out
    Would you like to tell us about it? We are at edge of our seats
    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
    Anyone know how to make express.static serve symlinked files?
    When a file is a symlink, it doesn't work.
    Never met a Richardson I never liked
    @trusktr what kins of file

    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.use(express.urlencoded({extended: true}))

    router.get('/', (req, res) => {

    module.exports = router

    How i can resolve it?

    Thank U to who can help-me

    Jacob Schmidt
    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 });
    hello room

    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  : 
    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
    @rashid-naico_gitlab Use debugger statement and see the call stack.
    David Anderson

    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
    The route that is being hit is my authentication route
    How can I get the raw body from the request?