2021-04-28 21:48:35 +00:00
|
|
|
const URL = require('url');
|
|
|
|
fs = require('fs');
|
2021-05-03 18:58:45 +00:00
|
|
|
const { getFile } = require('../s3');
|
2021-04-28 21:48:35 +00:00
|
|
|
|
|
|
|
module.exports = function (req, res) {
|
|
|
|
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
|
|
const url = URL.parse(req.url, true);
|
2021-04-30 00:23:13 +00:00
|
|
|
|
|
|
|
if (!url.query.filename) return res.status(400).send("Must specify filename");
|
|
|
|
if (url.query.filename){
|
2021-05-03 18:58:45 +00:00
|
|
|
getFile(req, res, url, url.query.filename);
|
2021-04-30 00:23:13 +00:00
|
|
|
}
|
2021-04-28 21:48:35 +00:00
|
|
|
};
|