Skip to content

jewelsjacobs/apiblueprints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Blueprint, Hercule, + Drakov

Design, documentation and mock data fo API development

Requirements

NOTE: The IntelliJ IDEA Blueprint Plugin does not work.

Install

  • Install nodeJS

  • (optional) Install Blueprint editor and preview IDE

  • (optional) Install Atom API Blueprint Packages

  • (optional) Install REST client

  • Install grunt-cli and aglio globally:

                $ npm install grunt-cli aglio -g
    
  • Fork and clone repo

  • Navigate into app directory and install node modules:

                $ npm install
    

Create API Spec Documentation

  • Documentation follows the API Blueprint Format.

  • To allow the separation of requests, responses, and schemas as separate json files as well as resources as separate blue print files, hercule is used.

  • The structure of the spec should be as follows, i.e. for the alarm API:

                ├── alarm
                │   ├── alarm.apib
                │   └── includes
                │       ├── alarm-errors.json
                │       ├── alarm-request.json
                │       ├── alarm-response.json
                │       ├── alarm-schema.json
                │       ├── alarm.md
                │       └── alarms.md
    

Compile Blueprint and create documentation

  • Run grunt command to build compiled API Blueprint file and HTML documentation making sure to include the API name you included in the api directory, i.e. if the API directory and .apib was named alarm the command to run would be:

                $ grunt build:alarm
    

Run mock and documentation server

              $ node index.js

The mock and documentation server used is drakov.

The server will be running on http://localhost:4007.

API Documentation will be on http://localhost:4007.

The API routes as defined in the documentation will be shown in the console after the server has been started, i.e.

Drakov Console Output

About

API Blueprint, Hercule, + Drakov

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published