Coder Social home page Coder Social logo

rest-api-manager's Introduction

rest-api-manager

配合自己框架自动生成接口数据的测试工具

 

rest-api-manager

增加个示例,不然自己都忘了是怎么用的了。。。

setting 设置

API list URL:
https://xxx.com/video-api/v1/apis

API request URL:
https://xxx.com/video-api/v1

接口返回数据结构格式

{
    "status": 200,
    "state": 1,
    "code": 0,
    "message": "ok",
    "description": null,
    "occurred": null,
    "data": {}
}

接口列表的数据结构

地址:https://xxx.com/video-api/v1/apis
参考:public/demo/apis.json

{
    "data": {
        // API 的 URI 列表
        "apiPathList": {
            "Api": [
                "Api\/Index"
            ],
            "Cartoon": [
                "Cartoon\/Index",
                "Cartoon\/Mapping",
                "Cartoon\/Period",
                "Cartoon\/Source",
                "Cartoon\/Torrent"
            ],
            // ...
        },
        // 每个 API 的 REST 具体配置
        "apiInfoList": {
            "Api\/Index": {
                "sort": 1,
                "name": "Api\/Index",
                "brief": null,
                "description": "\u63a5\u53e3\u4fe1\u606f\u7ba1\u7406",
                "methods": {
                    "GET": {
                        "Default": {
                            "routeMapIgnore": false,
                            "uriParams": null,
                            "bodyParams": null,
                            "pattern": "",
                            "uri": "\/apis",
                            "routeMatch": null,
                            "routeMatchParamsIndex": null,
                            "routeNativeParams": null,
                            "description": null
                        }
                    },
                    "PUT": {
                        "Caches": {
                            "routeMapIgnore": false,
                            "uriParams": null,
                            "bodyParams": null,
                            "pattern": "\/caches",
                            "uri": "\/apis\/caches",
                            "routeMatch": null,
                            "routeMatchParamsIndex": null,
                            "routeNativeParams": "['_do'=>'Caches']",
                            "description": null
                        },
                        "Maps": {
                            "routeMapIgnore": false,
                            "uriParams": null,
                            "bodyParams": null,
                            "pattern": "\/maps",
                            "uri": "\/apis\/maps",
                            "routeMatch": null,
                            "routeMatchParamsIndex": null,
                            "routeNativeParams": "['_do'=>'Maps']",
                            "description": null
                        }
                    }
                },
                "uriPrefix": "\/apis",
                "routeMapIgnoreAll": true
            },
            // ...
        }
    }
}

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

# 复制 vue.config-example.js 并命名为 vue.config.js
# 然后修改文件中的路径和测试的IP和端口等相关配置为本地环境的配置
cp vue.config-example.js vue.config.js

npm run build

# 打包生成生产环境并输出到指定目录后,
# 复制 callbacks.example.js 更改名称为 callbacks.example.js
# 该文件中可以配置自定义的接口发送请求和响应回调的处理方法
# cd <打包输出的目录>
cd E:/Website/www/localhost/rest-api-manager
mv public/js/callback.example.js public/js/callback.js

Run your tests

npm run test

Lints and fixes files

npm run lint

Customize configuration

See Configuration Reference.

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.