be-more-hapi
Advanced tools
Comparing version 0.7.1 to 1.0.0-rc.1
@@ -13,23 +13,13 @@ 'use strict'; | ||
host: 'localhost', | ||
port: 3000 | ||
port: 3003 | ||
}); | ||
// setup swagger options | ||
var swaggerOptions = { | ||
apiVersion: Pack.version, | ||
basePath: 'http://localhost:3000', | ||
authorizations: { | ||
default: { | ||
type: "apiKey", | ||
passAs: "header", | ||
keyname: "authentication" | ||
} | ||
}, | ||
info: { | ||
version: Pack.version, | ||
title: 'be more hapi', | ||
description: 'This web API was built to demonstrate some of the hapi features and functionality.', | ||
contact: 'glennjonesnet@gmail.com', | ||
license: 'MIT', | ||
licenseUrl: '/license' | ||
description: 'This web API was built to demonstrate some of the hapi features and functionality.' | ||
} | ||
@@ -36,0 +26,0 @@ }; |
@@ -44,22 +44,50 @@ 'use strict'; | ||
standardHTTPErrors = [ | ||
{ code: 400, message: 'Bad Request' }, | ||
{ code: 500, message: 'Internal Server Error'} | ||
]; | ||
standardHTTPErrors = { | ||
'200': { | ||
'description': 'Success', | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Sum" | ||
} | ||
} | ||
}, | ||
'400': { | ||
'description': 'Bad Request' | ||
}, | ||
'500': { | ||
'description': 'Internal Server Error' | ||
} | ||
}; | ||
extendedHTTPErrors = [ | ||
{ code: 400, message: 'Bad Request' }, | ||
{ code: 404, message: 'Sum not found' }, | ||
{ code: 500, message: 'Internal Server Error'} | ||
]; | ||
fileHTTPErrors = [ | ||
{ code: 400, message: 'Bad Request' }, | ||
{ code: 415, message: 'Unsupported Media Type' }, | ||
{ code: 500, message: 'Internal Server Error'} | ||
]; | ||
extendedHTTPErrors = { | ||
'400': { | ||
'description': 'Bad Request' | ||
}, | ||
'404': { | ||
'description': 'Sum not found' | ||
}, | ||
'500': { | ||
'description': 'Internal Server Error' | ||
} | ||
}; | ||
fileHTTPErrors = { | ||
'400': { | ||
'description': 'Bad Request' | ||
}, | ||
'404': { | ||
'description': 'Unsupported Media Type' | ||
}, | ||
'500': { | ||
'description': 'Internal Server Error' | ||
} | ||
}; | ||
// adds the routes and validation for api | ||
@@ -102,3 +130,3 @@ routes = [{ | ||
'hapi-swagger': { | ||
responseMessages: standardHTTPErrors | ||
responses: standardHTTPErrors | ||
} | ||
@@ -137,3 +165,3 @@ }, | ||
'hapi-swagger': { | ||
responseMessages: standardHTTPErrors | ||
responses: standardHTTPErrors | ||
} | ||
@@ -164,3 +192,3 @@ }, | ||
'hapi-swagger': { | ||
responseMessages: standardHTTPErrors | ||
responses: standardHTTPErrors | ||
} | ||
@@ -190,3 +218,3 @@ }, | ||
'hapi-swagger': { | ||
responseMessages: standardHTTPErrors | ||
responses: standardHTTPErrors | ||
} | ||
@@ -217,3 +245,3 @@ }, | ||
'hapi-swagger': { | ||
responseMessages: standardHTTPErrors | ||
responses: standardHTTPErrors | ||
} | ||
@@ -242,3 +270,3 @@ }, | ||
'hapi-swagger': { | ||
responseMessages: extendedHTTPErrors | ||
responses: extendedHTTPErrors | ||
} | ||
@@ -265,3 +293,3 @@ }, | ||
'hapi-swagger': { | ||
responseMessages: standardHTTPErrors, | ||
responses: standardHTTPErrors, | ||
payloadType: 'form', | ||
@@ -303,3 +331,3 @@ nickname: 'storeit' | ||
'hapi-swagger': { | ||
responseMessages: extendedHTTPErrors, | ||
responses: extendedHTTPErrors, | ||
payloadType: 'form' | ||
@@ -345,3 +373,3 @@ } | ||
'hapi-swagger': { | ||
responseMessages: extendedHTTPErrors | ||
responses: extendedHTTPErrors | ||
} | ||
@@ -367,3 +395,3 @@ }, | ||
'hapi-swagger': { | ||
responseMessages: standardHTTPErrors | ||
responses: standardHTTPErrors | ||
} | ||
@@ -403,3 +431,3 @@ }, | ||
'hapi-swagger': { | ||
responseMessages: fileHTTPErrors, | ||
responses: fileHTTPErrors, | ||
payloadType: 'form' | ||
@@ -406,0 +434,0 @@ } |
{ | ||
"name": "be-more-hapi", | ||
"author": "Glenn Jones", | ||
"version": "0.7.1", | ||
"version": "1.0.0-rc.1", | ||
"description": "A example site using HAPI to build an API", | ||
@@ -27,5 +27,5 @@ "keywords": [ | ||
"handlebars": "1.3.x", | ||
"hapi": "10.0.x", | ||
"hapi-swagger": "https://api.github.com/repos/glennjones/hapi-swagger/tarball/", | ||
"joi": "6.7.x", | ||
"hapi": "11.0.x", | ||
"hapi-swagger": "https://api.github.com/repos/glennjones/hapi-swagger/tarball/dev", | ||
"joi": "6.9.1", | ||
"marked": "0.3.x", | ||
@@ -35,3 +35,5 @@ "mongoose": "4.1.x", | ||
"vision": "2.x", | ||
"hoek": "2.7.0" | ||
"hoek": "2.7.0", | ||
"h2o2": "4.0.1", | ||
"wreck": "6.3.0" | ||
}, | ||
@@ -38,0 +40,0 @@ "devDependencies": { |
@@ -28,3 +28,3 @@ # An API built to show off hapi.js | ||
4. Run `$ node bin/be-more-hapi` | ||
5. Connect to the server using `http://localhost:3000` | ||
5. Connect to the server using `http://localhost:3003` | ||
@@ -31,0 +31,0 @@ |
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
850423
49
3289
14
+ Addedh2o2@4.0.1
+ Addedwreck@6.3.0
+ Added@hapi/address@1.0.1(transitive)
+ Addedaccept@2.2.3(transitive)
+ Addedammo@2.1.2(transitive)
+ Addedb64@3.1.1(transitive)
+ Addedboom@3.2.24.3.15.3.3(transitive)
+ Addedcall@3.0.4(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addedcatbox@7.2.1(transitive)
+ Addedcatbox-memory@2.1.1(transitive)
+ Addedcontent@3.1.2(transitive)
+ Addedcryptiles@3.2.1(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedh2o2@4.0.1(transitive)
+ Addedhapi@11.0.5(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedheavy@4.1.1(transitive)
+ Addedhoek@3.0.44.3.1(transitive)
+ Addediron@3.0.1(transitive)
+ Addedisemail@2.2.1(transitive)
+ Addeditems@2.2.1(transitive)
+ Addedjoi@12.1.16.9.17.3.0(transitive)
+ Addedkilt@2.0.2(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmimos@3.1.1(transitive)
+ Addednigel@2.1.1(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedpeekaboo@2.0.2(transitive)
+ Addedpez@2.2.2(transitive)
+ Addedqs@6.14.0(transitive)
+ Addedshot@2.0.1(transitive)
+ Addedside-channel@1.1.0(transitive)
+ Addedside-channel-list@1.0.0(transitive)
+ Addedside-channel-map@1.0.1(transitive)
+ Addedside-channel-weakmap@1.0.2(transitive)
+ Addedstatehood@3.1.0(transitive)
+ Addedsubtext@3.0.2(transitive)
+ Addedtopo@2.1.1(transitive)
+ Addedvise@2.1.1(transitive)
+ Addedwreck@5.6.17.2.1(transitive)
- Removedaccept@1.1.0(transitive)
- Removedb64@2.0.1(transitive)
- Removedcall@2.0.2(transitive)
- Removedcatbox@6.0.0(transitive)
- Removedcatbox-memory@1.1.2(transitive)
- Removedcontent@1.0.2(transitive)
- Removedcryptiles@2.0.5(transitive)
- Removedhapi@10.0.1(transitive)
- Removedheavy@3.0.1(transitive)
- Removediron@2.1.3(transitive)
- Removedjoi@6.7.1(transitive)
- Removedkilt@1.1.1(transitive)
- Removedmimos@2.0.2(transitive)
- Removednigel@1.0.1(transitive)
- Removedpeekaboo@1.0.0(transitive)
- Removedpez@1.0.0(transitive)
- Removedqs@4.0.05.2.1(transitive)
- Removedshot@1.7.0(transitive)
- Removedstatehood@2.1.1(transitive)
- Removedsubtext@2.0.2(transitive)
- Removedvise@1.0.0(transitive)
Updatedhapi@11.0.x
Updatedhapi-swagger@https://api.github.com/repos/glennjones/hapi-swagger/tarball/dev
Updatedjoi@6.9.1