doc: match program and console output in synopsis.md
PR-URL: https://github.com/nodejs/node/pull/23006 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
363570c07d
commit
5942a3447a
@ -10,7 +10,7 @@ different options and ways to run scripts with Node.js.
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
An example of a [web server][] written with Node.js which responds with
|
An example of a [web server][] written with Node.js which responds with
|
||||||
`'Hello World!'`:
|
`'Hello, World!'`:
|
||||||
|
|
||||||
Commands displayed in this document are shown starting with `$` or `>`
|
Commands displayed in this document are shown starting with `$` or `>`
|
||||||
to replicate how they would appear in a user's terminal.
|
to replicate how they would appear in a user's terminal.
|
||||||
@ -71,7 +71,7 @@ const port = 3000;
|
|||||||
const server = http.createServer((req, res) => {
|
const server = http.createServer((req, res) => {
|
||||||
res.statusCode = 200;
|
res.statusCode = 200;
|
||||||
res.setHeader('Content-Type', 'text/plain');
|
res.setHeader('Content-Type', 'text/plain');
|
||||||
res.end('Hello World!\n');
|
res.end('Hello, World!\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
server.listen(port, hostname, () => {
|
server.listen(port, hostname, () => {
|
||||||
@ -94,7 +94,7 @@ Server running at http://127.0.0.1:3000/
|
|||||||
|
|
||||||
Now, open any preferred web browser and visit `http://127.0.0.1:3000`.
|
Now, open any preferred web browser and visit `http://127.0.0.1:3000`.
|
||||||
|
|
||||||
If the browser displays the string `Hello, world!`, that indicates
|
If the browser displays the string `Hello, World!`, that indicates
|
||||||
the server is working.
|
the server is working.
|
||||||
|
|
||||||
Many of the examples in the documentation can be run similarly.
|
Many of the examples in the documentation can be run similarly.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user