Paper wrapper is a library used for being able to easily create REST API's using express, it can also be used as middleware for express.
The goal of paper wrapper is to be able to create very easy and neat REST API's. Paper wrapper does this by wrapping around express and using 'modules', 'module methods' and 'module requests'.
Paper wrapper is currently available on the NPM registry and can be installed in your project using:
$ npm install paper-wrapper
or
$ yarn add paper-wrapper
You can find examples on how to use paper wrapper in the github repository.
Full documentation for paper wrapper is available at the projects's github wiki.
In paper wrapper there are a couple of key theories that need to be understood beforehand so it will be easier to use:
The module method is the definition of the last part of an endpoint (/api/module/method)
. The module method contains the handling of the request and sending the response.
Modules are in fact a bunch of module methods grouped together by name. Modules can have parents so it is easy to create very specific endpoints.
A module request is the request that is actually being made from the client. The module request contains a couple of properties that gives you more control over the request.
To run the tests for paper wrapper you first need to install all needed npm packages using:
$ npm install
then
$ npm test
to run actually run the tests. When this command is ran all tests should pass, if not please contact the project owner.
If you have any features that you would like to see in paper wrapper that are not currently available, please contribute to the project and create a pull request.