Skip to content

Commit

Permalink
as option
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Apr 7, 2023
1 parent 614c02d commit 6c1903f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions node18-http-server-stops-request/server1.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const http = require("http");

const server = http.createServer((req, res) => {
const server = http.createServer({ requestTimeout: Number.MAX_SAFE_INTEGER }, (req, res) => {
console.log(`${req.method} ${req.url}`);
req.on("data", (data) => console.log(`on data: ${data.length}B`));
req.on("close", () => console.log("req closed"));
Expand All @@ -14,8 +14,6 @@ const server = http.createServer((req, res) => {
res.write("Handling...\n");
});

server.requestTimeout = Number.MAX_SAFE_INTEGER;

server.listen(3000, () => {
console.log(`Listening on ${server.address().port}...`);
});

0 comments on commit 6c1903f

Please sign in to comment.