New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

coffeerest-api-doc

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffeerest-api-doc

Unfancy rest apis, automatic documentation generator extension for coffeerest-api

  • 0.1.47
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Unfancy rest apis, automatic documentation generator extension for coffeerest-api

Ouch! Is it that simple?

Just add these fields to your coffeerest-api model.coffee specification

       module.exports = 
         name: "project foo"
--->     doc:
--->       version: 1
--->       projectname: "Project foo"
--->       logo: "https://github.com/coderofsalvation/coffeerest-api/raw/master/coffeerest.png"
--->       host: "http://mydomain.com"
--->       homepage: "http://mydomain.com/about"
--->       security: "Requests are authorized by adding a 'X-Project-foo: YOURTOKEN' http header"
--->       description: "Welcome to the Core API Documentation. The Core API is the heart of Project foo and should never be confused with the public api."
--->       request: 
--->         curl: "curl -X {{method}} -H 'Content-Type: application/json' -H 'X-Project-Token: YOURTOKEN' '{{url}}' --data '{{payload}}' "
         resources:
           '/book/:category':
             post:
--->           description: 'adds a book'
--->           notes: "does not accept duplicates"
               payload:
                 foo:  
                   type: "string", 
                   minLength: 5, 
                   required: true 
--->               default: "foobar"              

Usage

npm install coffeerest-api
npm install coffeerest-api-doc

for servercode see coffeerest-api

Example output: markdown

$ coffee server.coffee &
$ curl -H 'Content-Type: application/json' http://localhost:8080/v1/doc/markdown > apidoc.md
$ curl -H 'Content-Type: application/json' http://localhost:8080/v1/doc/html     > index.html 

Voila, you have a wonderful markdown document which explains your API. As a BONUS you get a beautifull html too, which uses bootstrap css.

Keywords

FAQs

Package last updated on 05 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc