Added more variations to urban routes.

This commit is contained in:
2025-08-27 13:33:48 +02:00
parent 3b6397602f
commit 991c5ee70d
3 changed files with 32 additions and 3 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules
package-lock.json

View File

@@ -1,7 +1,7 @@
{
"name": "start-fermate-api",
"version": "2.1.0",
"main": "script.js",
"version": "2.1.1",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
@@ -15,5 +15,13 @@
"cors": "^2.8.5",
"express": "^5.1.0",
"node-fetch": "^3.3.2"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/Daniongithub/startfermate-api.git"
},
"bugs": {
"url": "https://github.com/Daniongithub/startfermate-api/issues"
},
"homepage": "https://github.com/Daniongithub/startfermate-api#readme"
}

View File

@@ -44,6 +44,8 @@ app.get('/fermata', async (req, res) => {
mezzo = "Non disponibile";
}
//Varianti linee
if(linea == "Linea 4" && destinazione == "Mirabilandia"){
linea = "Linea 4B";
}
@@ -52,9 +54,26 @@ app.get('/fermata', async (req, res) => {
linea = "Linea 4D";
}
if(linea == "Linea 4" && destinazione == "Classe via Liburna"){
linea = "Linea 4R";
}
if(linea == "Linea 4" && destinazione == "Classe Romea Vecchia"){
linea = "Linea 4R";
}
if(linea == "Linea 1" && destinazione == "Borgo Nuovo"){
linea = "Linea 1B";
}
//Linee soppresse a metà
const linee = ["Linea 1", "Linea 1B", "Linea 2", "Linea 3", "Linea 4", "Linea 4B", "Linea 4D", "Linea 5", "Linea 8", "Linea 18", "Linea 70", "Linea 80"];
if(linee.includes(linea) && destinazione == "Stazione FS"){
linea = linea + "/";
}
results.push({
linea,
destinazione,