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

@@ -1,10 +1,10 @@
{
"name": "beammp-website",
"version": "1.0.0",
"version": "1.0.1",
"description": "BeamMP Website",
"main": "index.js",
"scripts": {
"docker-build": "docker build -t 192.168.100.6:5000/beammp/website:latest -t 192.168.100.6:5000/beammp/website:1.0.0 .",
"docker-build": "docker build -t 192.168.100.6:5000/beammp/website:latest -t 192.168.100.6:5000/beammp/website:1.0.1 .",
"docker-push": "docker push 192.168.100.6:5000/beammp/website:latest"
},
"repository": {

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