hapi-swagger
Advanced tools
Comparing version 1.3.0 to 2.0.0
var t = require('joi'); | ||
var handler = function(request) { | ||
request.reply('ok'); | ||
var handler = function(request, reply) { | ||
reply('ok'); | ||
}; | ||
@@ -7,0 +6,0 @@ |
@@ -28,6 +28,7 @@ var Hapi = require('hapi'), | ||
server.start(function(){ | ||
console.log('Server running at:', server.info.uri); | ||
console.log('server running at:', server.info.uri); | ||
}); | ||
}); | ||
server.route(Routes); | ||
server.route(Routes); | ||
{ | ||
"name": "hapi-swagger", | ||
"description": "A swagger documentation UI generator plugin for hapi", | ||
"version": "1.3.0", | ||
"version": "2.0.0", | ||
"author": "Glenn Jones", | ||
@@ -21,7 +21,7 @@ "repository": { | ||
"dependencies": { | ||
"handlebars": "^1.3.0", | ||
"handlebars": "^4.0.0", | ||
"boom": "^2.8.0", | ||
"hoek": "^2.14.0", | ||
"joi": "~6.6.1", | ||
"shortid": "^2.2.2" | ||
"joi": "~6.7.0", | ||
"shortid": "^2.2.2" | ||
}, | ||
@@ -34,3 +34,3 @@ "devDependencies": { | ||
"chai": "^1.9.2", | ||
"hapi": "^9.0.1", | ||
"hapi": "^10.0.0", | ||
"istanbul": "^0.3.17" | ||
@@ -42,4 +42,4 @@ }, | ||
"peerDependencies": { | ||
"hapi": "^9.0.1" | ||
"hapi": "^9.0.1 || ^10.0.0" | ||
} | ||
} |
# hapi-swagger | ||
This is a [Swagger UI](https://github.com/wordnik/swagger-ui) plug-in for [HAPI](http://hapijs.com/) v9.x or v10.x When installed it will self document HTTP API interface in a project. | ||
This is a [Swagger UI](https://github.com/wordnik/swagger-ui) plug-in for [HAPI](http://hapijs.com/) v9.x When installed it will self document HTTP API interface in a project. | ||
[![build status](https://img.shields.io/travis/glennjones/hapi-swagger.svg?style=flat-square)](http://travis-ci.org/glennjones/hapi-swagger) | ||
[![npm downloads](https://img.shields.io/npm/dm/hapi-swagger.svg?style=flat-square)](https://www.npmjs.com/package/hapi-swagger) | ||
[![MIT license](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.github.com/glennjones/microformat-shic/master/license.txt) | ||
[![npm downloads](https://img.shields.io/npm/dm/hapi-swagger.svg?style=flat-square)](https://www.npmjs.com/package/hapi-swaggered-ui) | ||
## Install | ||
@@ -14,3 +15,3 @@ | ||
You will also need to install the `inert` and `vision` plugs-ins which support tamplates and static content serving. | ||
You will also need to install the `inert` and `vision` plugs-ins which support templates and static content serving. | ||
@@ -177,3 +178,3 @@ $ npm install inert --save | ||
* `auth`: string The auth strategy to use if enableDocumentationPage is `true` - default: `false`, | ||
* `endpoint`: string the JSON endpoint that descibes the API - default: `/docs` | ||
* `endpoint`: string the JSON endpoint that describes the API - default: `/docs` | ||
* `pathPrefixSize`: number Selects what segment of the URL path is used to group endpoints - default: `1` | ||
@@ -260,7 +261,7 @@ * `payloadType`: string Weather accepts `json` or `form` parameters for payload - default: `json` | ||
### File upload | ||
The plug-in has basic support for file uploads into your API's. Below is an example of a route with a file uplaod, the three important elements are: | ||
The plug-in has basic support for file uploads into your API's. Below is an example of a route with a file upload, the three important elements are: | ||
* `payloadType: 'form'` in the plugins section creates a form for upload | ||
* `.meta({ swaggerType: 'file' })` add to the payload property you wish to be file upload | ||
* `payload` cnfiguration how HAPI will process file | ||
* `payload` configuration how HAPI will process file | ||
```Javascript | ||
@@ -293,3 +294,3 @@ { | ||
``` | ||
The https://github.com/glennjones/be-more-hapi project has an example of file upload with the handler function dealing with validation, sch as filetype and schema validation. | ||
The https://github.com/glennjones/be-more-hapi project has an example of file upload with the handler function dealing with validation, such as filetype and schema validation. | ||
@@ -296,0 +297,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
657711
43
11507
329
75363
+ Addedhandlebars@4.7.8(transitive)
+ Addedhapi@10.5.0(transitive)
+ Addedjoi@6.7.1(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedneo-async@2.6.2(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addeduglify-js@3.19.3(transitive)
+ Addedwordwrap@1.0.0(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedasync@0.2.10(transitive)
- Removedhandlebars@1.3.0(transitive)
- Removedhapi@9.5.1(transitive)
- Removedjoi@6.6.1(transitive)
- Removedoptimist@0.3.7(transitive)
- Removedsource-map@0.1.43(transitive)
- Removeduglify-js@2.3.6(transitive)
- Removedwordwrap@0.0.3(transitive)
Updatedhandlebars@^4.0.0
Updatedjoi@~6.7.0