api doc for swagger json and open api 2.0
Based on Swagger and Swagger Open API 2.0 Specification, a tool for generating API documentation by configuring Swagger JSON.
enum
displaywww.example.com/scopePath
to access, instead of directly accessing the domain name www.example.com
scopePath
is a configurable itemRewritten the setting
related code, the form validation is completely taken over by antd
Added enablePrivate
configuration, which is disabled by default. When enabled, it will enable the distinction between private and non-private interfaces.
Providing 2 ways to start
npm i @shuangren/share-api
yarn add @shuangren/share-api
// index.js
const ApiDoc = require('@shuangren/share-api');
const doc = new ApiDoc();
doc.start();
node index.js
git clone https://github.com/ShuangRen/share-api.git
npm install
yarn
node dist/server/start.js
// index.js
const ApiDoc = require('@shuangren/share-api');
const doc = new ApiDoc();
doc.config({
port: '3001',
password: 'abc123',
dataPath: '/var/demo/data.config'
});
doc.start();
Directly modify the configuration in the file dist/server/config
dataPath
data file that caches interface configuration list , Default dist/server
password
password when switched to internal access mode, Default is 123456
port
start port Default is 8081
ipList
An IP list that runs direct internal access, Default is []
scopePath
After enabling, Access using www.example.com/scopePath
, Default is empty string
, showed proxy-pass
, shareapi-static
to node server
enablePrivate
enable private config, Default is false
doc.config({
port: '3001',
password: 'abc123',
dataPath: '/var/demo/data.config'
ipList:[
'192.168.1.111',
'21.221.1.111'
],
scopePath = 'abc',
enablePrivate = true
});