mirror of
https://github.com/Daniongithub/startfermate-api.git
synced 2025-10-02 10:10:48 +00:00
Added more variations to urban routes.
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
package-lock.json
|
14
package.json
14
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "start-fermate-api",
|
"name": "start-fermate-api",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"main": "script.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node server.js"
|
"start": "node server.js"
|
||||||
},
|
},
|
||||||
@@ -15,5 +15,13 @@
|
|||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"express": "^5.1.0",
|
"express": "^5.1.0",
|
||||||
"node-fetch": "^3.3.2"
|
"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"
|
||||||
}
|
}
|
||||||
|
19
server.js
19
server.js
@@ -44,6 +44,8 @@ app.get('/fermata', async (req, res) => {
|
|||||||
mezzo = "Non disponibile";
|
mezzo = "Non disponibile";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Varianti linee
|
||||||
|
|
||||||
if(linea == "Linea 4" && destinazione == "Mirabilandia"){
|
if(linea == "Linea 4" && destinazione == "Mirabilandia"){
|
||||||
linea = "Linea 4B";
|
linea = "Linea 4B";
|
||||||
}
|
}
|
||||||
@@ -52,9 +54,26 @@ app.get('/fermata', async (req, res) => {
|
|||||||
linea = "Linea 4D";
|
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"){
|
if(linea == "Linea 1" && destinazione == "Borgo Nuovo"){
|
||||||
linea = "Linea 1B";
|
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({
|
results.push({
|
||||||
linea,
|
linea,
|
||||||
destinazione,
|
destinazione,
|
||||||
|
Reference in New Issue
Block a user