一个把mssql的sql、pro转为webapi的eggjs插件
以前一个项目的简化版,准备重构逐渐完善一下。
// {app_root}/config/config.default.js exports.mssql2webapi = { urlprefix: ‘/api/’, apitable: { emr: {// api/emr/ db: { server: ‘d.vy01.com’, user: ‘sa’, password: ‘test.123456’, database: ‘db1’, }, apis: [{//http://127.0.0.1:7001/emr/getuser?usercode=2 name: ‘getuser’, sql: ‘api_getuser’, type: ‘pro’, result:‘object’ }, {//http://127.0.0.1:7001/emr/findusers name: ‘findusers’, sql: ‘select * from users where objectstatus>0’, type: ‘sql’, result:‘array’ }], }, ris: { db: {}, apis: [], }, }, }; see config/config.default.js