mirror of https://github.com/docker/docs.git
Merge pull request #12355 from david-szabo97/patch-2
Node.js guide: Fix syntax highlighting
This commit is contained in:
commit
4bf9708018
|
@ -35,7 +35,7 @@ Now, let’s add some code to handle our REST requests. We’ll use a mock serve
|
|||
|
||||
Open this working directory in your IDE and add the following code into the `server.js` file.
|
||||
|
||||
```node
|
||||
```js
|
||||
const ronin = require( 'ronin-server' )
|
||||
const mocks = require( 'ronin-mocks' )
|
||||
|
||||
|
@ -72,7 +72,7 @@ $ curl http://localhost:8000/test
|
|||
|
||||
Switch back to the terminal where our server is running. You should now see the following requests in the server logs.
|
||||
|
||||
```node
|
||||
```
|
||||
2020-XX-31T16:35:08:4260 INFO: POST /test
|
||||
2020-XX-31T16:35:21:3560 INFO: GET /test
|
||||
```
|
||||
|
|
|
@ -184,7 +184,7 @@ Let’s change the source code and then set a breakpoint.
|
|||
|
||||
Add the following code to the server.js file on line 19 and save the file.
|
||||
|
||||
```node
|
||||
```js
|
||||
server.use( '/foo', (req, res) => {
|
||||
return res.json({ "foo": "bar" })
|
||||
})
|
||||
|
|
|
@ -37,7 +37,7 @@ Now, let’s add some code to handle our REST requests. We’ll use a mock serve
|
|||
|
||||
Open this working directory in your IDE and add the following code into the `server.js` file.
|
||||
|
||||
```node
|
||||
```js
|
||||
const ronin = require( 'ronin-server' )
|
||||
const mocks = require( 'ronin-mocks' )
|
||||
|
||||
|
@ -72,7 +72,7 @@ $ curl http://localhost:8000/test
|
|||
|
||||
Switch back to the terminal where our server is running. You should now see the following requests in the server logs.
|
||||
|
||||
```node
|
||||
```
|
||||
2020-XX-31T16:35:08:4260 INFO: POST /test
|
||||
2020-XX-31T16:35:21:3560 INFO: GET /test
|
||||
```
|
||||
|
|
|
@ -200,7 +200,7 @@ Let’s change the source code and then set a breakpoint.
|
|||
|
||||
Add the following code above the existing `server.use()` statement, and save the file.
|
||||
|
||||
```node
|
||||
```js
|
||||
server.use( '/foo', (req, res) => {
|
||||
return res.json({ "foo": "bar" })
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue