Giter VIP home page Giter VIP logo

express-stream's People

Contributors

corysimmons avatar pem-- 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

Watchers

 avatar  avatar  avatar  avatar

Forkers

pem--

express-stream's Issues

GET http://127.0.0.1:5000/ net::ERR_INCOMPLETE_CHUNKED_ENCODING

Im getting this error on chrome. My code:

let express = require("express");
let app = express();
let ejs = require('ejs');
let stream = require('express-stream');


app.set("view engine", "ejs");
app.set('port', (process.env.PORT || 5000));
app.use(express.static("public"));

stream.useAllAutoTags(true);
stream.streamBefore('pre-body-view');
stream.streamAfter('post-body-view');

module.exports.response = ()=>{

    app.get("/",stream.stream(),(req,res)=>{
        res.render("index");
        res.close();
    });

    app.get("/#",stream.stream(),(req,res)=>{
        res.render("index");
    });

    app.get("/sidebar",stream.stream(),(req,res)=>{
        res.render("sidebar");
    });

    app.get("/local",stream.stream(),(req,res)=>{
        res.render("local");
    });

    app.get("/cardapio",stream.stream(),(req,res)=>{
        res.render("cardapio");
    });

    app.get("/ajax",stream.stream(),(req,res)=>{
        res.render("../public/data/index");
        console.log("ajax");
    });

    app.get("/ajaxlocal",stream.stream(),(req,res)=>{
        res.render("../public/data/local");
    });

    app.get("/ajaxcardapio",stream.stream(),(req,res)=>{
        res.render("../public/data/cardapio");
    });

    app.listen(app.get('port'), function() {
      console.log('Node app is running on port', app.get('port'));
    });

}

Caching?

Hi!

Your streaming implementation looks great for streaming server-side rendered templates! Do you also cache the compiled templates like express does by default?

TypeError: res.close is not a function

hey,
I am getting this error TypeError: res.close is not a function.

There is nothing much in code actually.

home: async function (req, res) {

    res.stream("head");

    res.close();
  },

Please help.

Browser hangs if pug templates are used

Have you checked with pug, I think there may be some problem when using res.end() and the response is not flushed with the last chunk, the browser hangs for a long time without any error and the last chunk is not sent to the browser.

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.