Giter Site home page Giter Site logo

lightenpan / shuangren-doc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shuangren/shuangren-doc

0.0 2.0 0.0 118 KB

基于js 的 api文档,可以在线请求接口,只需2步即可写好接口文档。轻量,方便,快捷

JavaScript 96.18% HTML 0.09% Vue 3.73%

shuangren-doc's Introduction

ShuangRen-doc

基于js 的 api文档,可以在线请求接口,只需2步即可写好接口文档。轻量,方便,快捷

打包配置

1.安装nodejs

2.执行npm install

3.执行npm run build

4.打开build文件夹下的index.html

4.在线demo:http://api.webzeal.cn

使用手册

1.config/config.code.js 用于书写错误码,按规则填写即可

2.config/config.api.js 用于遍历,每个接口对应一个 key->value 比如 userlist:用户列表, 按示范填写即可

3.api/api.xx.js 则是接口文档,注意xx对应上一步的 config.api.js中的 key ,需要一致,比如userlist ,这里文件名则为api.userlist.js

4.api/api.xx.js参数说明:title:接口地址,name:中文名,methods:请求方式,req:请求参数,res:返回参数

5.config/config.main.js 配置文件,参数有:domain:接口域名, public:每个接口公共的参数,如index.php,没有可不填, headers:请求头,没有可不填

6.关于js请求跨域解决:1.使用proxy服务器代理,2.接口的header 里 增加Access-Control-Allow-Origin:*, 3.配置chorme参数实现允许跨域访问

shuangren-doc's People

Contributors

shuangren avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.