mirror of
https://github.com/Daniongithub/startfermate-api.git
synced 2025-10-02 12:10:49 +00:00
New variants
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "start-fermate-api",
|
"name": "start-fermate-api",
|
||||||
"version": "2.1.3",
|
"version": "2.1.4",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node server.js"
|
"start": "node server.js"
|
||||||
|
24
server.js
24
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.3";
|
const version = "2.1.4";
|
||||||
|
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
@@ -48,28 +48,36 @@ app.get('/fermata', async (req, res) => {
|
|||||||
|
|
||||||
//Varianti linee
|
//Varianti linee
|
||||||
|
|
||||||
|
if(linea == "1" && destinazione == "Borgo Nuovo"){
|
||||||
|
linea = "1B";
|
||||||
|
}
|
||||||
|
|
||||||
if(linea == "4" && destinazione == "Mirabilandia"){
|
if(linea == "4" && destinazione == "Mirabilandia"){
|
||||||
linea = "4B";
|
linea = "4B";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(linea == "4" && (destinazione == "Classe Cantoniera" || destinazione == "ClasseCantoniera")){
|
||||||
|
linea = "4C";
|
||||||
|
}
|
||||||
|
|
||||||
if(linea == "4" && destinazione == "Lido di Dante"){
|
if(linea == "4" && destinazione == "Lido di Dante"){
|
||||||
linea = "4D";
|
linea = "4D";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(linea == "4" && destinazione == "Classe via Liburna"){
|
if(linea == "4" && (destinazione == "Classe via Liburna" || "Classe Romea Vecchia")){
|
||||||
linea = "4R";
|
linea = "4R";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(linea == "4" && destinazione == "Classe Romea Vecchia"){
|
//Linee limitate o soppresse a metà
|
||||||
linea = "4R";
|
|
||||||
|
if(linea == "8" && destinazione == "Deposito"){
|
||||||
|
linea = "8/";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(linea == "1" && destinazione == "Borgo Nuovo"){
|
if(linea == "3" && destinazione == "via Sant'Alberto"){
|
||||||
linea = "1B";
|
linea = "3/";
|
||||||
}
|
}
|
||||||
|
|
||||||
//Linee soppresse a metà
|
|
||||||
|
|
||||||
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"){
|
||||||
|
Reference in New Issue
Block a user