const Mock = require('mockjs')
Mock.mock('/api/data', (req, res) => { return Mock.mock({ 'string|3': '*' }) })
Mock.mock('/api/getInteger', (req, res) => { return Mock.mock({ 'a|1-100': 100 }) })
Mock.mock('/api/getObject', (req, res) => { return Mock.mock({ 'brand|1-3': { a: '京东', b: '国美', c: '苏宁', d: '当当', e: '天猫', f: '淘宝' } }) })
Mock.mock('/api/getArr', (req, res) => { return Mock.mock({ 'data|1-10': [ { 'name': '张三' } ] }) })
Mock.mock('/api/getRandom1', (req, res) => { return Mock.mock({ 'random1': /[a-z]{2}[A-Z]{2}[0-9]/ }) })
Mock.mock('/api/getRandom2', (req, res) => { return Mock.mock({random2: '@string("lower", 5)'}) })
Mock.mock('/api/getUUID', (req, res) => { return {'uuid': Mock.Random.id()} })
|