代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/Easy-Mock 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
'use strict'
const config = require('config')
const Router = require('koa-router')
const restc = require('restc').koa2()
const ratelimit = require('koa-ratelimit')
const {
user,
mock,
util,
group,
project,
dashboard
} = require('./controllers')
const baseUtil = require('./util')
const middleware = require('./middlewares')
const rateLimitConf = config.get('rateLimit')
const apiRouter = new Router({ prefix: '/api' })
const mockRouter = new Router({ prefix: '/mock' })
const rate = ratelimit({
db: baseUtil.getRedis(),
id: ctx => ctx.url,
max: rateLimitConf.max,
duration: rateLimitConf.duration,
errorMessage: 'Sometimes You Just Have to Slow Down.',
headers: {
remaining: 'Rate-Limit-Remaining',
reset: 'Rate-Limit-Reset',
total: 'Rate-Limit-Total'
}
})
exports.mock = mockRouter
.all('*', middleware.mockFilter, rate, restc, mock.getMockAPI)
exports.api = apiRouter
.get('/wallpaper', util.wallpaper)
.post('/upload', util.upload)
.get('/dashboard', dashboard.list)
.get('/u', user.list)
.post('/u/login', user.login)
.post('/u/update', user.update)
.post('/u/register', user.register)
.get('/group', group.list)
.post('/group/join', group.join)
.post('/group/create', group.create)
.post('/group/delete', group.delete)
.post('/group/update', group.update)
.get('/project', project.list)
.post('/project/copy', project.copy)
.post('/project/create', project.create)
.post('/project/update', project.update)
.post('/project/delete', project.delete)
.post('/project/sync/swagger', project.syncSwagger)
.post('/project/update_workbench', project.updateWorkbench)
.get('/mock', mock.list)
.get('/mock/by_projects', mock.getAPIByProjectIds)
.post('/mock/create', mock.create)
.post('/mock/update', mock.update)
.post('/mock/delete', mock.delete)
.post('/mock/export', mock.exportAPI)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。