mirror of
https://github.com/BeamMP/BeamMP-Website.git
synced 2026-04-03 06:16:21 +00:00
Add legacy download route
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
1
src/static/builds/launcher/version.json
Normal file
1
src/static/builds/launcher/version.json
Normal file
@@ -0,0 +1 @@
|
||||
2.0.81
|
||||
Reference in New Issue
Block a user