Add legacy download route

This commit is contained in:
Starystars67
2023-12-06 20:02:51 +00:00
parent e21428b535
commit 696376662f
3 changed files with 21 additions and 2 deletions

View File

@@ -18,6 +18,24 @@ function mainRoutes(router) {
res.send('OK');
});
/**
* Backwards Compat for OLD launcher versions
*/
router.get('/builds/launcher', function(req, res) {
if (req.query.download == 'true') {
//res.download('https://backend.beammp.com/builds/launcher?download=true')
const file = `${__dirname}/static/builds/launcher/launcher.exe`;
res.download(file); // Set disposition and send it.
} else if (req.query.version == 'true') {
//res.redirect('https://backend.beammp.com/builds/launcher?version=true')
const file = `${__dirname}/static/builds/launcher/version.json`;
res.download(file); // Set disposition and send it.
} else {
//res.sendStatus(403)
res.send("Not Found!")
}
});
/**
* Redirects
*/

View File

@@ -0,0 +1 @@
2.0.81