diff --git a/examples/1-standard/app.js b/examples/1-standard/app.js index 1de69e01..8b55477f 100644 --- a/examples/1-standard/app.js +++ b/examples/1-standard/app.js @@ -1,6 +1,7 @@ const express = require('express'); const path = require('path'); const http = require('http'); +const cookieParser = require('cookie-parser'); // Add if using cookie auth const { Pets } = require('./services'); const OpenApiValidator = require('express-openapi-validator'); @@ -12,6 +13,7 @@ const apiSpec = path.join(__dirname, 'api.yaml'); app.use(express.urlencoded({ extended: false })); app.use(express.text()); app.use(express.json()); +app.use(cookieParser()); // Add if using cookie auth enables req.cookies // Optionally serve the API spec app.use('/spec', express.static(apiSpec)); diff --git a/examples/2-standard-multiple-api-specs/app.js b/examples/2-standard-multiple-api-specs/app.js index 8f002ea8..2fb9bf07 100644 --- a/examples/2-standard-multiple-api-specs/app.js +++ b/examples/2-standard-multiple-api-specs/app.js @@ -1,12 +1,15 @@ const express = require('express'); +const cookieParser = require('cookie-parser'); const path = require('path'); const http = require('http'); + const OpenApiValidator = require('express-openapi-validator'); app = express(); app.use(express.urlencoded({ extended: false })); app.use(express.text()); app.use(express.json()); +app.use(cookieParser()); // add if using cookie auth const versions = [1, 2];