UNPKG

cra-template-doly

Version:

[![npm][npm]][npm-url] ![GitHub](https://img.shields.io/github/license/doly-dev/cra-template-doly.svg)

27 lines (24 loc) 682 B
const mockUtil = require('./utils'); const data = [ { name: 'util-helpers', full_name: 'doly-dev/util-helpers', html_url: 'https://github.com/doly-dev/util-helpers', description: '一个基于业务场景的工具方法库' }, { name: 'rc-hooks', full_name: 'doly-dev/rc-hooks', html_url: 'https://github.com/doly-dev/rc-hooks', description: 'React Hooks Library.' } ]; module.exports = { 'GET /users/doly-dev/repos': mockUtil.mockData({ data }), 'GET /repos/doly-dev/:repoName': mockUtil.mockData(async (req) => { const { repoName } = req.params; return { data: data.find((item) => item.name === repoName) }; }) };