mirror of
https://github.com/Daniongithub/startfermate-api.git
synced 2025-10-02 09:30:48 +00:00
New variations with winter timetable.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "start-fermate-api",
|
"name": "start-fermate-api",
|
||||||
"version": "2.1.6",
|
"version": "2.2",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node server.js"
|
"start": "node server.js"
|
||||||
|
23
server.js
23
server.js
@@ -5,7 +5,7 @@ const cors = require('cors');
|
|||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = 3005;
|
const port = 3005;
|
||||||
const version = "2.1.6";
|
const version = "2.2";
|
||||||
|
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
@@ -41,11 +41,11 @@ app.get('/fermata', async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(stato == "Non disp"){
|
if(stato == "Non disp"){
|
||||||
stato = "Non disponibile";
|
stato = "N.D.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mezzo == ""){
|
if(mezzo == ""){
|
||||||
mezzo = "Non disponibile";
|
mezzo = "N.D.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(destinazione == "Fornace.Zarattini"){
|
if(destinazione == "Fornace.Zarattini"){
|
||||||
@@ -86,6 +86,15 @@ app.get('/fermata', async (req, res) => {
|
|||||||
linea = "4R";
|
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à
|
//Linee limitate o soppresse a metà
|
||||||
|
|
||||||
if(linea == "8" && destinazione == "Deposito"){
|
if(linea == "8" && destinazione == "Deposito"){
|
||||||
@@ -96,12 +105,20 @@ app.get('/fermata', async (req, res) => {
|
|||||||
linea = "3/";
|
linea = "3/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(linea == "1" && destinazione == "Antica Milizia"){
|
||||||
|
linea = "1/";
|
||||||
|
}
|
||||||
|
|
||||||
const linee = ["1", "1B", "3", "4", "4B", "4D", "5", "8", "18", "70", "80"];
|
const linee = ["1", "1B", "3", "4", "4B", "4D", "5", "8", "18", "70", "80"];
|
||||||
|
|
||||||
if(linee.includes(linea) && destinazione == "Stazione FS"){
|
if(linee.includes(linea) && destinazione == "Stazione FS"){
|
||||||
linea = linea + "/";
|
linea = linea + "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(linee.includes(linea) && destinazione == "STAZIONE FS"){
|
||||||
|
linea = linea + "/";
|
||||||
|
}
|
||||||
|
|
||||||
results.push({
|
results.push({
|
||||||
linea,
|
linea,
|
||||||
destinazione,
|
destinazione,
|
||||||
|
Reference in New Issue
Block a user