Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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
    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 Stack Boilerplate
    @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