mirror of
https://github.com/PretendoNetwork/BOSS.git
synced 2026-07-04 09:00:57 -05:00
Dirty subfolder hack
This commit is contained in:
parent
290bbfcc04
commit
e02fd12ecb
|
|
@ -19,6 +19,18 @@ npts.get('/p01/tasksheet/:id/:hash/:fileName', (request, response) => {
|
|||
}
|
||||
});
|
||||
|
||||
npts.get('/p01/tasksheet/:id/:hash/:subfolder/:fileName', (request, response) => {
|
||||
const { id, hash, subfolder, fileName } = request.params;
|
||||
const tasksheetPath = path.normalize(`${__dirname}/../../cdn/tasksheet/${id}/${hash}/_subfolder/${subfolder}/${fileName}`);
|
||||
|
||||
if (fs.existsSync(tasksheetPath)) {
|
||||
response.set('Content-Type', 'text/xml');
|
||||
response.sendFile(tasksheetPath);
|
||||
} else {
|
||||
response.sendStatus(404);
|
||||
}
|
||||
});
|
||||
|
||||
// Main router for endpoints
|
||||
const router = express.Router();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user