autorun-apidoc

1.0.1 • Public • Published

autorun-apidoc

Installation

$ npm install git+https://github.com/hfrely/autorun-apidoc.git
$ sudo npm install -g apidoc

Example of use

const express = require('express');
const AutorunApidoc = require('autorun-apidoc');

AutorunApidoc.port(4000); // Default: 3030
AutorunApidoc.dirname('/Users/hfrely/api/apidoc/'); // Default: yourProject/../apidoc
AutorunApidoc.run(); // Run apidoc: http://localhost:4000

let app = express();

/**
* @api {get} / get OK
* @apiName getOk
* @apiGroup GET
*
* @apiSuccessExample {json} OK
*     HTTP/1.1 200 OK
*     {
*       "test": "OK"
*     }
*
*/
app.get('/', (req, res) => {
    res.json({test: 'OK'});
});

app.listen(3000);

Docs

AutorunApidoc.port(4000): Use this function to choose your port. Default port 3030

AutorunApidoc.dirname('/Users/hfrely/api/apidoc/'): Use this function to choose your folder for apidoc. Default folder yourProject/../apidoc

AutorunApidoc.run(): Run your apidoc

Readme

Keywords

none

Package Sidebar

Install

npm i autorun-apidoc

Weekly Downloads

1

Version

1.0.1

License

none

Last publish

Collaborators

  • hfrely