Skip to content

Commit

Permalink
removed unused dependency cookie-parser in examples and in readme, as…
Browse files Browse the repository at this point in the history
… well as exposing none existing public dir as static in express examples
  • Loading branch information
xtrycatchx committed Jul 22, 2020
1 parent 754c0af commit 3a11f19
Show file tree
Hide file tree
Showing 16 changed files with 132 additions and 255 deletions.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ See the complete [source code](https://github.com/cdimascio/express-openapi-vali
```javascript
const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const logger = require('morgan');
const http = require('http');
Expand All @@ -101,8 +100,6 @@ app.use(bodyParser.text());
app.use(bodyParser.urlencoded({ extended: false }));

app.use(logger('dev'));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

// 3. (optionally) Serve the OpenAPI spec
const spec = path.join(__dirname, 'example.yaml');
Expand Down Expand Up @@ -215,7 +212,6 @@ Below are some code snippets:
```javascript
const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const logger = require('morgan');
const http = require('http');
Expand All @@ -231,8 +227,6 @@ app.use(bodyParser.text());
app.use(bodyParser.json());
app.use(logger('dev'));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/spec', express.static(apiSpec));
Expand Down Expand Up @@ -954,7 +948,6 @@ async function main() {
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.text());
app.use(bodyParser.json());
app.use(express.static(path.join(__dirname, 'public')));
const versions = [1, 2];
Expand Down
3 changes: 0 additions & 3 deletions examples/1-standard/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const logger = require('morgan');
const http = require('http');
Expand All @@ -17,8 +16,6 @@ app.use(bodyParser.text());
app.use(bodyParser.json());

app.use(logger('dev'));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/spec', express.static(apiSpec));

Expand Down
67 changes: 24 additions & 43 deletions examples/1-standard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion examples/1-standard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"license": "MIT",
"dependencies": {
"body-parser": "^1.19.0",
"cookie-parser": "^1.4.5",
"express-openapi-validator": "file:../../",
"morgan": "^1.10.0"
},
Expand Down
1 change: 0 additions & 1 deletion examples/2-standard-multiple-api-specs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ async function main() {
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.text());
app.use(bodyParser.json());
app.use(express.static(path.join(__dirname, 'public')));

const versions = [1, 2];

Expand Down
74 changes: 28 additions & 46 deletions examples/2-standard-multiple-api-specs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion examples/2-standard-multiple-api-specs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"license": "MIT",
"dependencies": {
"body-parser": "^1.19.0",
"cookie-parser": "^1.4.5",
"express-openapi-validator": "file:../../",
"morgan": "^1.10.0"
},
Expand Down
3 changes: 0 additions & 3 deletions examples/3-eov-operations/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const logger = require('morgan');
const http = require('http');
Expand All @@ -16,8 +15,6 @@ app.use(bodyParser.text());
app.use(bodyParser.json());

app.use(logger('dev'));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/spec', express.static(apiSpec));

Expand Down
Loading

0 comments on commit 3a11f19

Please sign in to comment.