You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

23 lines
587 B

/**
* Created by PengLing on 2018/1/2.
*/
'use strict';
const Attachment = require('fs-attachment');
module.exports = {
entry: function (app, router, opts) {
const attachment = new Attachment(opts);
app.fs = app.fs || {};
app.fs.attachment = attachment;
app.fs.logger.log('debug', 'init fs.attachment and inject it into app(app.fs.attachment) and runtime ctx(ctx.fs.attachment)');
return async (ctx, next) => {
ctx.fs = ctx.fs || {};
ctx.fs.attachment = attachment;
await next();
};
}
};