Skip to content

Commit

Permalink
(flavor) swagger v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
devinivy committed Apr 12, 2021
1 parent 839e7af commit 2a479ff
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "lib/index.js",
"scripts": {
"start": "node server",
"test": "lab -a @hapi/code -L",
"test": "lab -a @hapi/code -I \"__core-js_shared__,CSS,regeneratorRuntime,core\" -L",
"lint": "eslint ."
},
"dependencies": {
Expand All @@ -18,14 +18,17 @@
"@hapi/eslint-plugin-hapi": "4.x.x",
"@hapi/glue": "8.x.x",
"@hapi/hapi": "20.x.x",
"@hapi/inert": "6.x.x",
"@hapi/lab": "24.x.x",
"@hapi/vision": "6.x.x",
"@hapipal/confidence": "6.x.x",
"@hapipal/hpal": "3.x.x",
"@hapipal/hpal-debug": "2.x.x",
"@hapipal/toys": "3.x.x",
"babel-eslint": "10.x.x",
"dotenv": "8.x.x",
"eslint": "7.x.x",
"exiting": "6.x.x"
"exiting": "6.x.x",
"hapi-swagger": "14.x.x"
}
}
3 changes: 3 additions & 0 deletions server/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ module.exports = new Confidence.Store({
plugin: '../lib', // Main plugin
options: {}
},
{
plugin: './plugins/swagger'
},
{
plugin: {
$filter: 'NODE_ENV',
Expand Down
25 changes: 25 additions & 0 deletions server/plugins/swagger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'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
}
}
}
]);
}
};

0 comments on commit 2a479ff

Please sign in to comment.