|
|
@ -18,9 +18,13 @@ const ext = { |
|
|
|
module.exports = { |
|
|
|
entry: function (app, router, opts) { |
|
|
|
const getApiRoot = async function (ctx) { |
|
|
|
const { apiUrl, qndmn } = opts; |
|
|
|
ctx.status = 200; |
|
|
|
ctx.body = { root: apiUrl, qndmn }; |
|
|
|
try { |
|
|
|
const { apiUrl, qndmn } = opts; |
|
|
|
ctx.status = 200; |
|
|
|
ctx.body = { root: apiUrl, qndmn }; |
|
|
|
} catch (error) { |
|
|
|
console.error('getApiRoot', error) |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
let upload = async function (ctx, next) { |
|
|
@ -84,7 +88,7 @@ module.exports = { |
|
|
|
} |
|
|
|
|
|
|
|
router.get('/api/root', getApiRoot); |
|
|
|
router.post('/_upload/new', upload); |
|
|
|
router.delete('/_upload/cleanup', remove); |
|
|
|
// router.post('/_upload/new', upload);
|
|
|
|
// router.delete('/_upload/cleanup', remove);
|
|
|
|
} |
|
|
|
}; |
|
|
|