Skip to content

Commit 899faf0

Browse files
committed
fix(swagger): update the config for Swagger
1 parent 82dd23d commit 899faf0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/swagger/options.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const config = require('../config/config.json');
33
exports.options = {
44
routePrefix: '/swagger',
55
exposeRoute: true,
6+
staticCSP: true,
7+
transformStaticCSP: (header) => header,
68
swagger: {
79
info: {
810
title: 'Encryption API with Node.js',
@@ -18,4 +20,8 @@ exports.options = {
1820
consumes: ['application/json'],
1921
produces: ['application/json'],
2022
},
23+
uiConfig: {
24+
docExpansion: 'full',
25+
deepLinking: false,
26+
},
2127
};

test/functional/swagger.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const config = require('../../src/config/config.json');
55
// Swagger
66
describe('Swagger endpoint response', () => {
77
it('should return 200', (done) => {
8-
request.get(`http://localhost:${config.app.port}/swagger/index.html`, (err, res) => {
8+
request.get(`http://localhost:${config.app.port}/swagger/`, (err, res) => {
99
if (err) throw err;
1010
expect(res.statusCode).to.equal(200);
1111
done();

0 commit comments

Comments
 (0)