This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 25f2a50
Showing
10 changed files
with
1,419 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
bower_components | ||
coverage | ||
.DS_Store | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
bower_components | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"maxerr": 100, // Maximum errors before stopping. | ||
"maxlen": 80, // Maximum line length. | ||
"quotmark": "single", // Consistent quotation mark usage. | ||
"bitwise": false, // Prohibit bitwise operators (&, |, ^, etc.). | ||
"curly": true, // Require {} for every new block or scope. | ||
"eqeqeq": true, // Require triple equals i.e. `===`. | ||
"forin": false, // Tolerate `for in` loops without `hasOwnPrototype`. | ||
"immed": true, // Require immediate invocations to be wrapped in parens. E.g. `(function(){})();`. | ||
"latedef": false, // Prohibit variable use before definition. | ||
"newcap": true, // Require capitalization of all constructor functions. E.g. `new F()`. | ||
"noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`. | ||
"noempty": true, // Prohibit use of empty blocks. | ||
"nonew": true, // Prohibit use of constructors for side-effects. | ||
"undef": true, // Require all non-global variables be declared before they are used. | ||
"unused": true, // Warn when creating a variable but never using it. | ||
"plusplus": false, // Prohibit use of `++` & `--`. | ||
"regexp": false, // Prohibit `.` and `[^...]` in regular expressions. | ||
"strict": false, // Require `use strict` pragma in every file. | ||
"trailing": true, // Prohibit trailing whitespaces. | ||
"boss": true, // Tolerate assignments inside if, for and while. Usually conditions and loops are for comparison, not assignments. | ||
"multistr": false, // Prohibit the use of multi-line strings. | ||
"eqnull": true, // Tolerate use of `== null`. | ||
"expr": true, // Tolerate `ExpressionStatement` as Programs. | ||
"node": true, // Support globals used in a node environment. | ||
"browser": true // Support globals used in a browser environment. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: node_js | ||
|
||
notifications: | ||
email: | ||
on_success: never | ||
on_failure: change | ||
|
||
node_js: | ||
- "0.10" | ||
|
||
after_script: "npm install coveralls@2 && cat ./coverage/lcov.info | coveralls" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2015 (c) MuleSoft, Inc. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
either express or implied. See the License for the specific | ||
language governing permissions and limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Osprey Method Handler | ||
|
||
[![NPM version][npm-image]][npm-url] | ||
[![NPM Downloads][downloads-image]][downloads-url] | ||
[![Build status][travis-image]][travis-url] | ||
[![Test coverage][coveralls-image]][coveralls-url] | ||
|
||
Middleware for validating requests and responses based on a [RAML method](https://github.com/raml-org/raml-spec/blob/master/raml-0.8.md#methods) object. | ||
|
||
## Installation | ||
|
||
```sh | ||
npm install osprey-method-handler --save | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
var express = require('express'); | ||
var handler = require('osprey-method-handler'); | ||
|
||
express.post('/users', handler({ | ||
headers: {}, | ||
responses: { | ||
'200': { | ||
body: { | ||
'application/json': { | ||
schema: '...', | ||
example: '...' | ||
} | ||
} | ||
} | ||
}, | ||
body: { | ||
'application/json': { | ||
schema: '...' | ||
} | ||
} | ||
}), function (req, res) { | ||
res.send('it worked!'); | ||
}); | ||
``` | ||
|
||
## License | ||
|
||
MIT license | ||
|
||
[npm-image]: https://img.shields.io/npm/v/osprey-method-handler.svg?style=flat | ||
[npm-url]: https://npmjs.org/package/osprey-method-handler | ||
[downloads-image]: https://img.shields.io/npm/dm/osprey-method-handler.svg?style=flat | ||
[downloads-url]: https://npmjs.org/package/osprey-method-handler | ||
[travis-image]: https://img.shields.io/travis/mulesoft-labs/osprey-method-handler.svg?style=flat | ||
[travis-url]: https://travis-ci.org/mulesoft-labs/osprey-method-handler | ||
[coveralls-image]: https://img.shields.io/coveralls/mulesoft-labs/osprey-method-handler.svg?style=flat | ||
[coveralls-url]: https://coveralls.io/r/mulesoft-labs/osprey-method-handler?branch=master |
Oops, something went wrong.