|
|
@ -62,7 +62,7 @@ function startup() {
|
|
|
|
|
|
|
|
|
|
|
|
// View file
|
|
|
|
// View file
|
|
|
|
app.get('/:resourceId', (req, res) => {
|
|
|
|
app.get('/:resourceId', (req, res) => {
|
|
|
|
let resourceId = req.params.resourceId;
|
|
|
|
let resourceId = req.params.resourceId.split('.')[0];
|
|
|
|
let fileData = fs.readFileSync(path(data[resourceId].path));
|
|
|
|
let fileData = fs.readFileSync(path(data[resourceId].path));
|
|
|
|
if (data[resourceId]) res.header('Accept-Ranges', 'bytes').header('Content-Length', fileData.byteLength).type(data[resourceId].mimetype).send(fileData);// .sendFile(path(data[resourceId].path));
|
|
|
|
if (data[resourceId]) res.header('Accept-Ranges', 'bytes').header('Content-Length', fileData.byteLength).type(data[resourceId].mimetype).send(fileData);// .sendFile(path(data[resourceId].path));
|
|
|
|
else res.sendStatus(404);
|
|
|
|
else res.sendStatus(404);
|
|
|
|