Skip to content

Commit

Permalink
add cookies to example 1 and 2
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed Jan 27, 2024
1 parent f806690 commit 1bb17e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/1-standard/app.js
Original file line number Diff line number Diff line change
@@ -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');

Expand All @@ -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));
Expand Down
3 changes: 3 additions & 0 deletions examples/2-standard-multiple-api-specs/app.js
Original file line number Diff line number Diff line change
@@ -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];

Expand Down

0 comments on commit 1bb17e8

Please sign in to comment.