Skip to content

Commit a97dcfd

Browse files
authored
library: body-parser json removed as it's deprecated and used express.json functionality (#2221)
1 parent c189d88 commit a97dcfd

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

run/pubsub/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ For more details on how to work with this sample read the [Google Cloud Run Node
99
## Dependencies
1010

1111
* **express**: Web server framework.
12-
* **body-parser**: express middleware for request payload processing.
1312
* **mocha**: [development] Test running framework.
1413
* **supertest**: [development] HTTP assertion test client.

run/pubsub/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
// [START cloudrun_pubsub_server_setup]
66
// [START run_pubsub_server_setup]
77
const express = require('express');
8-
const bodyParser = require('body-parser');
98
const app = express();
109

11-
app.use(bodyParser.json());
10+
// This middleware is available in Express v4.16.0 onwards
11+
app.use(express.json());
1212
// [END run_pubsub_server_setup]
1313
// [END cloudrun_pubsub_server_setup]
1414

run/pubsub/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"system-test": "mocha test/system.test.js --timeout=300000 --exit"
2020
},
2121
"dependencies": {
22-
"body-parser": "^1.19.0",
2322
"express": "^4.16.4"
2423
},
2524
"devDependencies": {

0 commit comments

Comments
 (0)