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 {
|
2020-04-29 23:45:50 +00:00
|
|
|
code: 404, message: 'no file'
|
2020-03-17 22:16:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = CdnController
|