Update nodejs example (#449)

Update the express version to mitigate some security vulnerabilities.

Update the port to match the one used by demo.yml.

Change to /usr/src/app so npm install works as expected.
This commit is contained in:
Mark Stemm 2018-10-26 05:51:33 -07:00 committed by GitHub
parent ef9c4ee6ab
commit 8c6ebd586d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -42,7 +42,7 @@ This starts the following containers:
Run the following commands to execute arbitrary commands like 'ls', 'pwd', etc:
```
$ curl http://localhost:8080/api/exec/ls
$ curl http://localhost:8181/api/exec/ls
demo.yml
node_modules
@ -52,7 +52,7 @@ server.js
```
```
$ curl http://localhost:8080/api/exec/pwd
$ curl http://localhost:8181/api/exec/pwd
.../examples/nodejs-bad-rest-api
```

View File

@ -1,7 +1,7 @@
express_server:
container_name: express_server
image: node:latest
command: bash -c "apt-get -y update && apt-get -y install runit && npm install && runsv /usr/src/app"
command: bash -c "apt-get -y update && apt-get -y install runit && cd /usr/src/app && npm install && runsv /usr/src/app"
ports:
- "8181:8181"
volumes:

View File

@ -2,6 +2,6 @@
"name": "bad-rest-api",
"main": "server.js",
"dependencies": {
"express": "~4.0.0"
"express": "~4.16.0"
}
}