New variations with winter timetable.

This commit is contained in:
2025-09-15 16:50:22 +02:00
parent 8d77764751
commit 48f892c0a8
2 changed files with 21 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "start-fermate-api",
"version": "2.1.6",
"version": "2.2",
"main": "server.js",
"scripts": {
"start": "node server.js"

View File

@@ -5,7 +5,7 @@ const cors = require('cors');
const app = express();
const port = 3005;
const version = "2.1.6";
const version = "2.2";
app.use(cors());
app.use(express.json());
@@ -41,11 +41,11 @@ app.get('/fermata', async (req, res) => {
}
if(stato == "Non disp"){
stato = "Non disponibile";
stato = "N.D.";
}
if(mezzo == ""){
mezzo = "Non disponibile";
mezzo = "N.D.";
}
if(destinazione == "Fornace.Zarattini"){
@@ -86,6 +86,15 @@ app.get('/fermata', async (req, res) => {
linea = "4R";
}
if(linea == "4" && destinazione == "R.Vecchia"){
linea = "4R";
}
if(linea == "4" && destinazione == "Classe"){
linea = "4R";
destinazione = "Classe Piazza";
}
//Linee limitate o soppresse a metà
if(linea == "8" && destinazione == "Deposito"){
@@ -96,12 +105,20 @@ app.get('/fermata', async (req, res) => {
linea = "3/";
}
if(linea == "1" && destinazione == "Antica Milizia"){
linea = "1/";
}
const linee = ["1", "1B", "3", "4", "4B", "4D", "5", "8", "18", "70", "80"];
if(linee.includes(linea) && destinazione == "Stazione FS"){
linea = linea + "/";
}
if(linee.includes(linea) && destinazione == "STAZIONE FS"){
linea = linea + "/";
}
results.push({
linea,
destinazione,