Skip to content

Swagger Documentation Guideline

SHEMA Eric edited this page Dec 1, 2019 · 1 revision

How to run swagger document

  • Locally

     type in your browser:  http://localhost:3000/API/v1/docs/ 
    
  • Remotely

      type in your browser: <heroku link>/API/v1/docs/ 
    

How to document the API

  • First, create a file

    The API can be documented in JSDoc-style with swagger spec in YAML.

    how to write a file in YAML, resource here

  • Include your file into a swagger index file

    This is an example of how to include your file in the index

    `apis: [

      // all swagger API files will be included here like below example
    
      // this is an example of how to include file : path.resolve(__dirname,'./Users.js'),
    
      path.resolve(__dirname,'./Users.js'),
    
      path.resolve(__dirname,'./Login.js'),
    

    ] `