Axios模拟路由器 像koa-router一样模拟axios 例子 import AxiosMockRouter from 'axios-mock-router' import axios from 'axios' const router = new AxiosMockRouter(axios); router .get('https://github.com/', (ctx, next) => { ctx.body = 'github'; }) .get('/', (ctx, next) => { ctx.body = 'home'; }) .get(