echart

echart JS library on npm Download echart JS library

mock service

Version 0.1.3
echart has no homepage
echart JS library on GitHub
echart JS library on npm
Download echart JS library
Keywords
mockmockJSONmockservice
INSTALL
Type:
<script type="module"> import echart from 'https://cdn.jsdelivr.net/npm/echart@0.1.3/+esm' </script>
Learn more

#moc

前端构造数据服务

安装

npm i moc --save

# global install

sudo npm i moc -g
import moc from 'moc'

const config = {
    mockRoot: __dirname, // 默认项目跟目录
    port: 3000, // 启动端口
    tasks: { // 任务处理函数
        modifyTask (ctx, next) {
            return {
                data: 0,
                message: 'success'
            }
        },
        webTask (ctx, next) {
            let {level, method} = ctx.params
            return `./web/${level}/${method}`
        }
    },
    mapping: { // 请求任务映射关系
        modifyTask: ['**/modify', '**/update'],
        webTask: [
            'web/user/:level/:method'
        ]
    }
}

mock.start(config)