'use strict'; const indexRoute = '/admin'; const controller = require('./admin.controller'); const services = [ { url: '/in', method: 'POST', controller: controller.signin }, { url: '/actions', method: 'POST', controller: controller.getUserActions }, { url: '/tickets', method: 'POST', controller: controller.getDepositTicket }, { url: '/users', method: 'POST', controller: controller.getUsers }, { url: '/funds', method: 'POST', controller: controller.getFunds }, { url: '/vreqs', method: 'POST', controller: controller.getVreqs }, ]; module.exports = services.map(service => { // 可以在此处对要导出的服务map进行统一处理 service.url = indexRoute + service.url; return service; });