Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

response stream not correct #11

Open
jiawei397 opened this issue Dec 9, 2022 · 0 comments
Open

response stream not correct #11

jiawei397 opened this issue Dec 9, 2022 · 0 comments

Comments

@jiawei397
Copy link

nodejs:

const express = require("express");
const app = express();

app.get('/', function (req, res) {
  res.write('hello\n');
  setTimeout(() => {
    res.write('world');
    res.end();
  }, 5000);
});
app.listen(3000);

When curl http://localhost:3000, it will show hello first, then wait 5 seconds show world.

But it shows hello world in 5 seconds together in Deno.

import express from "npm:[email protected]";
const app = express();
app.get("/", (req, res) => {
  res.write("hello\n");
  setTimeout(() => {
    res.write("world");
    res.end();
  }, 5000);
});

app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant