merest-swagger
The extension of merest
that provides SWAGGER documentation support.
Installation
npm up merestnpm i --save merest-swagger
merest-swagger doesn't install the merest, so you should do it by yourself.
Recommended Installation
npm i --save merest merest-swagger mongoose express body-parser method-override
Documentation
http://dscheglov.github.io/merest/
Example
'use strict'; const merest = ; // to support SwaggerUIconst express = ;const bodyParser = ;const methodOverride = ; // Defining modelconst mongoose = ;const Contact = mongoose;mongoose; const app = ;// Creating the Express application to serve APIconst api = title: 'Contact List API' host: 'localhost:8000' // Assign correct host that could be accessed from your network path: '/api/v1' options: false // we do not need the OPTIONS any more; app; // Parsing JSON-bodiesapp; // Supporting HTTP OPTIONS and HTTP DELETE methods api; // Exposing our APIapi; // Exposing swagger-ui app; // mounting API as usual sub-application app;
Going to swagger-ui in browser: http://localhost:8000/swagger-ui