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
|
|
|
};
|