From 09980a3cf28cdf96640e91750bd7e3fca6e27bc4 Mon Sep 17 00:00:00 2001 From: Carmine DiMascio Date: Sat, 6 Mar 2021 21:20:25 -0500 Subject: [PATCH] doc: update README --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 72da1d19..cc9530b7 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,6 @@ See the complete [source code](https://github.com/cdimascio/express-openapi-vali ```javascript const express = require('express'); const path = require('path'); -const bodyParser = require('body-parser'); const http = require('http'); const app = express(); @@ -105,9 +104,9 @@ const OpenApiValidator = require('express-openapi-validator'); // 2. Set up body parsers for the request body types you expect // Must be specified prior to endpoints in 5. -app.use(bodyParser.json()); -app.use(bodyParser.text()); -app.use(bodyParser.urlencoded({ extended: false })); +app.use(express.json()); +app.use(express.text()); +app.use(express.urlencoded({ extended: false })); // 3. (optionally) Serve the OpenAPI spec const spec = path.join(__dirname, 'api.yaml');