Set the asset server to use jp cdn for now
This commit is contained in:
parent
156034fec7
commit
3fb178f24f
@ -19,11 +19,9 @@ app.get('/*', function (req, res) {
|
|||||||
createDirFromFile(expectedPath);
|
createDirFromFile(expectedPath);
|
||||||
let downloading = [];
|
let downloading = [];
|
||||||
if (fs.existsSync(expectedPath)) {
|
if (fs.existsSync(expectedPath)) {
|
||||||
const fileStream = fs.createReadStream(expectedPath);
|
res.sendFile(expectedPath)
|
||||||
res.writeHead(200);
|
|
||||||
fileStream.pipe(res);
|
|
||||||
} else {
|
} else {
|
||||||
let url = (!req.url.toLowerCase().startsWith("android") ? "https://img-sif2.lovelive-sif2.com" : "https://album-sif2.lovelive-sif2.com") + req.url;
|
let url = (req.url.toLowerCase().startsWith("/android") || req.url.toLowerCase().startsWith("/ios") ? "https://lovelive-schoolidolfestival2-assets.akamaized.net" : "https://lovelive-schoolidolfestival2-album.akamaized.net") + req.url;
|
||||||
const request = require('https').get(url, function(response) {
|
const request = require('https').get(url, function(response) {
|
||||||
response.pipe(res);
|
response.pipe(res);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user