iut-hapi/server/plugins/swagger.js

34 lines
896 B
JavaScript
Raw Normal View History

2021-04-12 03:24:17 +00:00
'use strict';
const Inert = require('@hapi/inert');
const Vision = require('@hapi/vision');
const HapiSwagger = require('hapi-swagger');
const Package = require('../../package.json');
module.exports = {
name: 'app-swagger',
async register(server) {
await server.register([
Inert,
Vision,
{
plugin: HapiSwagger,
options: {
info: {
version: Package.version
2021-04-12 03:24:17 +00:00
},
securityDefinitions : {
'jwt' : {
'type' : 'apiKey',
'name' : 'Authorization',
'in' : 'header'
}
},
security : [{ 'jwt' : [] }],
2021-04-12 03:24:17 +00:00
}
}
]);
}
2021-04-12 03:24:17 +00:00
};