seepur/app/Controllers/Http/CdnController.js

17 lines
342 B
JavaScript
Raw Normal View History

2020-03-17 22:16:34 +00:00
'use strict'
const FileUtils = use('App/Utils/FileUtils');
class CdnController {
async publicImages({request, response}) {
const file = await FileUtils.getFile(request.params.fileName);
if (file)
response.send(file);
else
return {
code: 404, message: 'no file'
2020-03-17 22:16:34 +00:00
}
}
}
module.exports = CdnController