DokuIn.js
Lets you make documentation for your REST API easier. New to DokuIn.js ? Take a look at the Tutorial and Guide
Table of Contents
Installation
Make sure you have Node.js and NPM installed. Then you can install DokuIn.js in your machine globally with command
$ npm install -g dokuinjs
Usage
Run DokuIn.js in your terminal with command
$ dokuin init
Provide your project details
Project Name :Project Description :Project Base URL :Author :
### Run this command to show DokuIn.js menu list
$ dokuin start Please choose 1 command : [x] Create new configuration[ ] Create new endpoint list[ ] Run endpoint list[ ] Generate Markdown[ ] Show endpoint list[ ] Add new endpoint into endpoint list[ ] Update an endpoint on the list [ ] Delete endpoint in existing endpoint list
Choose second option to create new endpoints
You can put your endpoints as many as you want.
[x] Create new endpoint list
This option will show endpoint list
[x] Show endpoint list
Choose this one to get all responses from endpoint list
[x] Run endpoint list
And finally convert responses to Markdown file with this option
[x] Generate Markdown
Voila your documentation is ready!
Example
Install and make config file with DokuIn.js
$ npm i -g dokuinjs $ dokuin init Project Name : netfluxProject Description : it is practice project restful apiProject Base URL : http://localhost:3000Author : meggy
Create endpoint list
1. Example
$ dokuin start Please choose 1 command : [ ] Create new configuration[x] Create new endpoint list[ ] Run endpoint list[ ] Generate Markdown[ ] Show endpoint list[ ] Add new endpoint into endpoint list[ ] Update an endpoint on the list [ ] Delete endpoint in existing endpoint list HTTP Method : getPath: /productsEndpoint description : get all products Add Headers ? yesKey: tokenValue: dok23uin42js52ist52di32e78be67steAdd more headers ? no Add Query Params ? yesKey: idValue: w8974e89is0ooAdd more query params ? no Add Request Body ? noAdd more endpoints ? no
2. Example
$ dokuin start Please choose 1 command : [ ] Create new configuration[x] Create new endpoint list[ ] Run endpoint list[ ] Generate Markdown[ ] Show endpoint list[ ] Add new endpoint into endpoint list[ ] Update an endpoint on the list [ ] Delete endpoint in existing endpoint list HTTP method: putPath: /moviesEndpoint description: update one movie Add Headers ? : yesKey: tokenValue: dok23uin42js52ist52di32e78be67steAdd more headers ? no Add Query Params ? yesKey: movieIdValue: w8974e89is0ooAdd more query params ? no Add Request Body ? yesKey: titleValue: darkKey: genreValue: adventureAdd more request body ? yesKey: popularityValue: 34.912Add more request body ? no Add more endpoints ? : no
Show endpoint list
$ dokuin start Please choose 1 command : [ ] Create new configuration....[x] Show endpoint list.. .... ----------------------------------------------------------------------------|| id | Method | Path | Description || 1 | 1 | GET | http://localhost:3000 | Get all movies || 2 | 2 | POST | http://localhost:3000/login | login |----------------------------------------------------------------------------
Delete an endpoint
$ dokuin start Please choose 1 command : [ ] Create new configuration............[x] Delete endpoint in existing endpoint list ----------------------------------------------------------------------------|| id | Method | Path | Description || 1 | 1 | GET | http://localhost:3000 | Get all movies || 2 | 2 | POST | http://localhost:3000/login | login |----------------------------------------------------------------------------Endpoint ID : 1
Add new endpoints to the list
$ dokuin start Please choose 1 command : [ ] Create new configuration......[x] Add new endpoints into endpoint list.. .. HTTP Method : postPath: movies/ Add Headers ? noAdd Query Params ? noAdd Request Body ? yes Key: emailValue: test@dokuinjs.comAdd more Request Body ? yesKey: passwordValue: 12opw9d9sAdd more request body ? no Add more endpoints ? no
Update an endpoint on the list
$ dokuin start Please choose 1 command : [ ] Create new configuration..........[x] Update an endpoint on the list .. Which endpoint [x] GET, http://localhost:3000[ ] POST, http://localhost:3000/login [ ] method[ ] description[ ] path[ ] query [x] body Current Valuekey: username, value: caeasaradamvalue: <updated value> More update ? yes [x] GET, http://localhost:3000[ ] POST, http://localhost:3000/login Which key [x] method[ ] description[ ] path[ ] query [ ] body Current Value: GETHTTP Method: <updated method> More Update ? no
Run endpoint list
$ dokuin start Please choose 1 command : [ ] Create new configuration..[x] Run endpoints........ ..
Convert responses
$ dokuin start Please choose 1 command : [ ] Create new configuration....[x] Generate Markdown...... ..