api-blueprint-boilerplate
api-blueprint-boilerplate copied to clipboard
Minimalistic boilerplate to quick-start API specification using API Blueprint description language.
api-blueprint-boilerplate
Minimalistic boilerplate to quick-start API specification using API Blueprint description language.
Provides a basic template for REST API documentation that contains some best practices for a pragmatic RESTful API and a set of tools to validate API Blueprint schema or export specification to HTML files.
Sample project is available in Apary: http://docs.apiblueprintboilerplate.apiary.io/
Quick start
This project requires Node.js 6.2+, NPM, Ruby and Bundler. So just make sure you have those installed. Then just type following commands:
git clone https://github.com/jsynowiec/api-blueprint-boilerplate
cd api-blueprint-boilerplate
npm install
bundle install
npm start
You now have a local preview server available at http://localhost:8080 that is validating and rendering your blueprint using Apiary CLI.
Testing against specification
To test the blueprint run npm test
command. This will validate the schema using Drafter.js library.
Export HTML files
To compile the blueprint run npm run build
. Files will be written to the build
directory.
Publishing to Apiary
To publish your blueprint to Apiary.io you have to set two environment variables:
export APIARY_API_KEY="<token>"
export APIARY_API_NAME="<apiary project name>"
After that, you can run npm run publish
command to upload your blueprint to Apiary project. You can also provide those two values before the command
APIARY_API_KEY="<token>" APIARY_API_NAME="<apiary project name>" npm run publish
Resources
- API Blueprint,
- API Blueprint Specification,
- MSON Specification,
- VS Code API Elements extension,
- Apiary.io,
- Drafter.js,
License
MIT License. See the LICENSE file.