Git Product home page Git Product logo

express-mvc's People

Contributors

basemkhirat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

express-mvc's Issues

ERR_HTTP_HEADERS_SENT

Hello,
I am using your mvc solution and I get the [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client error sometimes.
Here is an example:

0|server  | Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
0|server  |     at ServerResponse.setHeader (_http_outgoing.js:470:11)
0|server  |     at ServerResponse.header (/var/www/scrapper-node/node_modules/express/lib/response.js:767:10)
0|server  |     at ServerResponse.send (/var/www/scrapper-node/node_modules/express/lib/response.js:170:12)
0|server  |     at done (/var/www/scrapper-node/node_modules/express/lib/response.js:1004:10)
0|server  |     at tryHandleCache (/var/www/scrapper-node/node_modules/ejs/lib/ejs.js:257:5)
0|server  |     at View.exports.renderFile [as engine] (/var/www/scrapper-node/node_modules/ejs/lib/ejs.js:482:10)
0|server  |     at View.render (/var/www/scrapper-node/node_modules/express/lib/view.js:135:8)
0|server  |     at tryRender (/var/www/scrapper-node/node_modules/express/lib/application.js:640:10)
0|server  |     at Function.render (/var/www/scrapper-node/node_modules/express/lib/application.js:592:3)
0|server  |     at ServerResponse.render (/var/www/scrapper-node/node_modules/express/lib/response.js:1008:7)
0|server  |     at ServerResponse.res.render (/var/www/scrapper-node/node_modules/express-flash/lib/express-flash.js:29:16)
0|server  |     at ServerResponse.res.render (/var/www/scrapper-node/app/kernel.js:129:20)
0|server  |     at index (/var/www/scrapper-node/app/controllers/VideoController.js:13:28)
0|server  |     at process._tickCallback (internal/process/next_tick.js:68:7)

VideoController.js looks like this:

module.exports = {
    /**
     * @param  {Object} req
     * @param  {Object} res
     * @param  {Function} next
     */
    index: async(req, res, next) => {
        const id = req.params.id
        if(typeof id === 'undefined') return res.notFound('Invalid video id')
        try {
            const cached = await CacheService.get(id)
            if (cached) {
                return res.render('video', JSON.parse(cached)) ### // Here is line 13
            }
            else {
                const video = await Video.findById(id)
                if (video === null) return res.notFound('Video not found')

                const links = VideoStreamService.create(req, res, id, video)

                if (links.status === 500) {
                    return res.notFound('No active sources found')
                }
                CacheService.set(id, JSON.stringify({
                    links: links.data
                }))
                return res.render('video', {
                    links: links.data
                })
            }
        }
        catch (err) {
            // next(err)
            return res.badRequest('Temporary error. Try again later or choose another mirror.')
        }

    },
}

How to update the mongoose's version which has come along with this npm?

I've been using this module to design my application's folder structure. Its working fine. But now it's giving errors when am using some other modules which are dependent on mongoose and mongodb. This module still has older versions of mongoose and mongodb as it wasn't updated in last 2 years. But I've to update the mongoose to the newest version as per my requirements. But I couldn't able to do that. I've got mongoose and mongodb modules as part of this module. How to update both mongo db and mongoose node modules?

Mongoose upgrade issue

Please merge the changes of mongoose branch to master so that we could get updated npm versions for which I've been waiting from so long

run on prodution env

great quickstart code , but can you plz add a fix for the producion env : i got

Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.

maybe something in
app.use(require("express-session")(_config("session")));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.