Tortilla-API
Tortilla-API is wrapper of restify and swaggerRestify for a quick and easy creation of REST API in node.
Getting Started
Install dependencies:
$ npm install tortilla-api
Demo
Clone the repo
$ git clone https://github.com/jobando89/tortilla-api.git
Inside the repo folder
$ npm install
$ npm start
Generate a get request to http://localhost:8080
Prerequisites
Tortilla-API the a file structure relative to where appRoot is setup.
Folder Structure
The api folder should contain a controllers and a swagger folder. The controllers folder contains the files for the swagger defined in x-swagger-router-controller for each swagger path. The swagger folder contains the swagger.yaml definition. The location of the application folders is defined in the appRoot prorperty inside the tortilla.create() method.
Configuration
Configuration Documentation
tortilla;
Configuration Example
const tortilla = ; tortilla;
Controller Documentation
The controller uses the api method implementation of restify.
For more information on restify properties see http://restify.com/docs/server-api/.
ControllerExample : Wrapper
Controller Method Example
const tortilla = ;const Wrapper = tortillawrapper; moduleexports= ControllerExample : Wrapper;
Tests
Unit Tests
$ npm run test
Code Coverage
$ npm run cover
Coding Style Tests
$ npm run lint