1. Download the Node. Js

nodejs.cn/download/

(Note: older versions of JS come with NPM, so we don’t need to install NPM separately.)

Check whether the installation is successful in CMD:

node -v

npm -v


2. Install apidoc

cnpm install apidoc -g


Check whether the installation is successful in CMD:

apidoc -v


3. Build the document directory:

I have set up the directory architecture, zip package is as follows:

Link: https://pan.baidu.com/s/1l_xiBNp0qdtgwGKXUPs1-A

The key is to write apidoc.json and myapp. Java files


4. Usage

In E: \ workspace \ apidoc \ apidoc \ in under:

Just edit the myapp.java file


Type the following command in CMD (note modifying path)

apidoc -i E:\workspace\apidoc\in -o E:\workspace\apidoc\out

Finally, open the index.html file under E:\workspace\apidoc\out

Note: In specific projects, developers will update the API developed by themselves and then submit it to the public disk or SVN to ensure that it is the latest document every time. Front-end developers only need to view it on the public disk or SVN during development, which saves time and effort and facilitates management.


Reference links:

http://www.bjhee.com/apidoc.html

https://segmentfault.com/q/1010000005801746