Added vietnam server

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk 2024-12-08 00:03:34 +01:00
parent 3ec9d9e5b9
commit cc43bceb03

View file

@ -111,6 +111,11 @@ export const SERVER = {
url: 'https://cdn-us-west1.organicmaps.app/',
dataVersions: 2,
},
vi1: {
// Vietnam, unlimited 1Gbps bandwidth
url: 'https://cdn-vi1.organicmaps.app/',
dataVersions: 5,
},
};
// Exported for tests.
@ -140,11 +145,20 @@ export async function getServersList(request: Request) {
// See https://developers.cloudflare.com/firewall/cf-firewall-language/fields for a list of all continents.
case 'NA': // North America
case 'SA': // South America
case 'OC': // Oceania
servers = [SERVER.us_east1, SERVER.us_west1, SERVER.uk1, SERVER.nl1, SERVER.planet].filter((server) =>
DATA_VERSIONS.slice(-server.dataVersions).includes(dataVersion),
);
break;
case 'OC': // Oceania
servers = [SERVER.vi1, SERVER.us_east1, SERVER.us_west1, SERVER.planet].filter((server) =>
DATA_VERSIONS.slice(-server.dataVersions).includes(dataVersion),
);
break;
case 'AS': // Asia
servers = [SERVER.vi1, SERVER.uk1, SERVER.nl1, SERVER.planet].filter((server) =>
DATA_VERSIONS.slice(-server.dataVersions).includes(dataVersion),
);
break;
default:
// Every other continent + Tor networks.
servers = [SERVER.planet, SERVER.uk1, SERVER.nl1, SERVER.fi1, SERVER.de1, SERVER.de2, SERVER.de3].filter(