Ghost/core/server/api/canary/files.js
Naz a099073fde Added Files API behind an alpha flag
refs https://github.com/TryGhost/Toolbox/issues/114

- Files API is meant to be used for non-executable file uploads of all sorts
- The files are stored and retrieved for download as-is
2021-11-08 11:40:17 +04:00

20 lines
441 B
JavaScript

const storage = require('../../adapters/storage');
module.exports = {
docName: 'files',
upload: {
statusCode: 201,
permissions: false,
async query(frame) {
const filePath = await storage.getStorage('files').save({
name: frame.file.originalname,
path: frame.file.path
});
return {
filePath
};
}
}
};