Skip to content

Commit

Permalink
doc: update code example for Windows in stream.md
Browse files Browse the repository at this point in the history
PR-URL: #13138
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
vsemozhetbyt authored and jasnell committed May 28, 2017
1 parent 3c91145 commit 2c45e6f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const server = http.createServer((req, res) => {
res.write(typeof data);
res.end();
} catch (er) {
// uh oh! bad json!
// uh oh! bad json!
res.statusCode = 400;
return res.end(`error: ${er.message}`);
}
Expand All @@ -143,12 +143,12 @@ const server = http.createServer((req, res) => {

server.listen(1337);

// $ curl localhost:1337 -d '{}'
// $ curl localhost:1337 -d "{}"
// object
// $ curl localhost:1337 -d '"foo"'
// $ curl localhost:1337 -d "\"foo\""
// string
// $ curl localhost:1337 -d 'not json'
// error: Unexpected token o
// $ curl localhost:1337 -d "not json"
// error: Unexpected token o in JSON at position 1
```

[Writable][] streams (such as `res` in the example) expose methods such as
Expand Down

0 comments on commit 2c45e6f

Please sign in to comment.