mirror of
https://github.com/BeamMP/BeamMP-Website.git
synced 2026-02-16 02:30:47 +00:00
Add legacy download route
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "beammp-website",
|
"name": "beammp-website",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "BeamMP Website",
|
"description": "BeamMP Website",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"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"
|
"docker-push": "docker push 192.168.100.6:5000/beammp/website:latest"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -18,6 +18,24 @@ function mainRoutes(router) {
|
|||||||
res.send('OK');
|
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
|
* 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