From 4c4f8001b9cdc59284fab030b0b692731edcb120 Mon Sep 17 00:00:00 2001 From: Anuj Pillai <56990215+anuj-2001@users.noreply.github.com> Date: Sat, 20 Feb 2021 20:17:10 +0530 Subject: [PATCH 1/9] Chose theme and working on the idea --- Readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Readme.md diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..2107e6f --- /dev/null +++ b/Readme.md @@ -0,0 +1 @@ +Theme : Travelling From f767028f26db9238e6a8be939e4b713c3cbf011b Mon Sep 17 00:00:00 2001 From: raunakjaiswal <65062751+raunakjaiswal@users.noreply.github.com> Date: Sat, 20 Feb 2021 23:42:03 +0530 Subject: [PATCH 2/9] Checked working of railway-trains-India API --- app.js | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ homescreen.hbs | 25 +++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 app.js create mode 100644 homescreen.hbs diff --git a/app.js b/app.js new file mode 100644 index 0000000..fb9d8c7 --- /dev/null +++ b/app.js @@ -0,0 +1,76 @@ +const express = require('express'); +const request = require('request'); +const hbs = require('hbs'); +const bodyparser = require('body-parser'); +const app =express(); +const path = require('path'); +// var railway = require('railway-api') + +const port = process.env.PORT || 3000; +app.use(bodyparser.json()); +app.use(bodyparser.urlencoded({ extended: false })) + + +app.set('views',path.join(__dirname,'templates/views')); +app.set('view engine','hbs'); + + +app.use(express.urlencoded({extended: true})); +app.use(express.json()); + +// app.use(app.router); +// routes.initialize(app); + +// app.use('/',require('./routes/pages')); + +app.get('/', function(req,res){ + // res.render('index'); + res.render('homescreen') +}); + +// app.get('/', function(req,res){ +// // res.render('index'); +// res.render('homescreen') +// }); + +// railway.setApikey('72a4b65e030c0f6316343d8564fe3e34') + +app.post('/check',function(req,res) +{ + // railway.checkPnr('<10 digit pnr>', function (err, res) {}) + // railway.name_number(req.body.trainnumber, function (err, res) { + + // console.log(res); + // }) + + var searchh = req.body.trainnumber; + console.log(searchh); + const options = { + method: 'POST', + url: 'https://trains.p.rapidapi.com/', + headers: { + 'content-type': 'application/json', + 'x-rapidapi-key': '11d26b13d3msh0c0e1f0eafa7297p1584a8jsn4c256b77a0d2', + 'x-rapidapi-host': 'trains.p.rapidapi.com', + useQueryString: true + }, + body: {search: searchh}, + json: true +}; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); + res.send(body); +}); + +}) + + + +app.listen(port,()=>{ + console.log(`servewr is on port ${port}`); +}); + +// module.exports = app; \ No newline at end of file diff --git a/homescreen.hbs b/homescreen.hbs new file mode 100644 index 0000000..f8d18c5 --- /dev/null +++ b/homescreen.hbs @@ -0,0 +1,25 @@ + + + + + + + Document + + +
+

Login Form

+ +
+ + + + + + + + + + + + \ No newline at end of file From 4298692516521478ddcffa3444a22e156d1170f3 Mon Sep 17 00:00:00 2001 From: Anuj Pillai <56990215+anuj-2001@users.noreply.github.com> Date: Sun, 21 Feb 2021 02:54:33 +0530 Subject: [PATCH 3/9] Frontend Files --- index.html | 51 +++++++++++++++++++++++++++++++++++ styles.css | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 index.html create mode 100644 styles.css diff --git a/index.html b/index.html new file mode 100644 index 0000000..61c024b --- /dev/null +++ b/index.html @@ -0,0 +1,51 @@ + + + + + RailConnect + +
+
+

RAIL-CONNECT

+
+ +
+ +
+
+
+
+
+ + +
+
+ + +
+ +
+
+
+
+
+
+

OUTPUT

+
+
+
+
+ + +
+

Developed by Team-13 DigestMeIfYouCan

+

Anuj Pillai | Raunak Jaiswal

+
+ \ No newline at end of file diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..bf17a3b --- /dev/null +++ b/styles.css @@ -0,0 +1,78 @@ +header { + text-align: left; + padding: 15px; + background-color: #3aafa9; + color: white; +} +.header-title{ + font-size: 30px; + font-weight: 600; + text-align: left; + padding-left: 30px; +} +body{ + background-color: rgb(255, 255, 255); + font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; +} +.container{ + height: 450px; + width: 500px; + margin: auto; + max-width: 90%; + max-height: 90%; +} +.container form{ + font-size: 25px ; + font-weight: 600; + height: 80%; + width: 80%; + padding : 30px; + background:white; + border-radius: 4px; + box-shadow: 0,8px,16px rgba(0, 0, 0, 0.3); +} +.container form .form-control{ + width:100%; + height: 40px; + background:white; + border: 1px solid silver ; + border-radius: 4px; + margin: 10px 0 18px 0; + padding : 0 10px; +} +.column { + float: left; + width: 40%; + padding: 0 10px; +} +.row { + margin: 0 -5px; +} +.row:after { + content: ""; + display: table; + clear: both; +} +.container form .btn{ + font-size: 30px ; + font-weight: 600; + margin-left:50%; + margin-top: 10%; + transform:translateX(-50%); + width: 120px; + height: 34px; + border: none; + outline : none; + background:#3aafa9; + cursor:pointer; + font-size: 16px; + color :white; + border-radius: 4px; + transition: .3s; +} +footer { + text-align: center; + padding: 3px; + background-color: #3aafa9; + color: white; +} \ No newline at end of file From 41d8bc4d0ee34b1156f062a0d3a57104f5e29430 Mon Sep 17 00:00:00 2001 From: Anuj Pillai <56990215+anuj-2001@users.noreply.github.com> Date: Sun, 21 Feb 2021 11:35:39 +0530 Subject: [PATCH 4/9] Backend files --- app.js | 123 ++++++++++++++++++++++++++++++++++++++++++-------------- auth.js | 81 +++++++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 31 deletions(-) create mode 100644 auth.js diff --git a/app.js b/app.js index fb9d8c7..83647e0 100644 --- a/app.js +++ b/app.js @@ -4,17 +4,25 @@ const hbs = require('hbs'); const bodyparser = require('body-parser'); const app =express(); const path = require('path'); +// const { url } = require('inspector'); +// const fs = require('fs'); + + + + // var railway = require('railway-api') const port = process.env.PORT || 3000; app.use(bodyparser.json()); app.use(bodyparser.urlencoded({ extended: false })) +app.use(express.static(path.join(__dirname,'public'))); app.set('views',path.join(__dirname,'templates/views')); app.set('view engine','hbs'); + app.use(express.urlencoded({extended: true})); app.use(express.json()); @@ -28,44 +36,97 @@ app.get('/', function(req,res){ res.render('homescreen') }); +app.use('/auth',require('./routes/auth')); // app.get('/', function(req,res){ // // res.render('index'); // res.render('homescreen') // }); // railway.setApikey('72a4b65e030c0f6316343d8564fe3e34') +// railway.checkPnr('<10 digit pnr>', function (err, res) {}) +// railway.name_number(req.body.trainnumber, function (err, res) { + +// console.log(res); +// }) + +// var krdosex ="h"; +// app.post('/check',function(req,res) +// { + + +// // var searchh = req.body.trainnumber; +// var source = req.body.from; +// var destination = req.body.to; +// console.log(source); +// console.log(destination); +// // res.send(source + destination); + +// _External_URL = `https://indianrailapi.com/api/v2/AllTrainOnStation/apikey/72a4b65e030c0f6316343d8564fe3e34/StationCode/${source}/`; + + +// var datastd; +// var usedata; +// const callexternalapi = (callback) => +// { + +// request(_External_URL , {json: true}, (err,res,body) => { +// if(err) +// { +// console.log(err); +// } +// else +// { + +// // datastd = JSON.stringify(body); +// // usedata = JSON.parse(datastd); +// const variableName = body; +// module.exports = variableName; +// // krdosex = `${usedata.Trains[0].TrainNo}`; +// // console.log(variableName); +// // console.log(usedata.Trains[0].TrainNo); +// // fs.writeFile("json.json",datastd,(err)=> +// // { +// // console.log("done"); +// // }) +// // console.log(datastd); +// // res.send(body); +// } +// }) + + +// } +// callexternalapi(); -app.post('/check',function(req,res) -{ - // railway.checkPnr('<10 digit pnr>', function (err, res) {}) - // railway.name_number(req.body.trainnumber, function (err, res) { - - // console.log(res); - // }) - - var searchh = req.body.trainnumber; - console.log(searchh); - const options = { - method: 'POST', - url: 'https://trains.p.rapidapi.com/', - headers: { - 'content-type': 'application/json', - 'x-rapidapi-key': '11d26b13d3msh0c0e1f0eafa7297p1584a8jsn4c256b77a0d2', - 'x-rapidapi-host': 'trains.p.rapidapi.com', - useQueryString: true - }, - body: {search: searchh}, - json: true -}; - -request(options, function (error, response, body) { - if (error) throw new Error(error); - - console.log(body); - res.send(body); -}); -}) +// }); +// // console.log(krdosex); + + +// // } +// // var datatrain=''; +// // var searchh = req.body.from; +// // const options = { +// // method: 'POST', +// // url: 'https://trains.p.rapidapi.com/', +// // headers: { +// // 'content-type': 'application/json', +// // 'x-rapidapi-key': '11d26b13d3msh0c0e1f0eafa7297p1584a8jsn4c256b77a0d2', +// // 'x-rapidapi-host': 'trains.p.rapidapi.com', +// // useQueryString: true +// // }, +// // body: {search: searchh}, +// // json: true +// // }; + +// // request(options, function (error, response, body) { +// // if (error) throw new Error(error); + +// // console.log(body); +// // datatrain=body; +// // // res.send(body); +// // }); +// // res.send(datastd); +// // }) @@ -73,4 +134,4 @@ app.listen(port,()=>{ console.log(`servewr is on port ${port}`); }); -// module.exports = app; \ No newline at end of file +module.exports = app; \ No newline at end of file diff --git a/auth.js b/auth.js new file mode 100644 index 0000000..acb079a --- /dev/null +++ b/auth.js @@ -0,0 +1,81 @@ +const express = require('express'); +const router = express.Router(); +const bcrypt = require('bcryptjs') +const request = require('request'); +const { json } = require('express'); + + + +router.post('/check',function(req,res) +{ + + + // var searchh = req.body.trainnumber; + var source = req.body.from; + var destination = req.body.to; + console.log(source); + console.log(destination); + // res.send(source + destination); + +_External_URL = `https://indianrailapi.com/api/v2/AllTrainOnStation/apikey/72a4b65e030c0f6316343d8564fe3e34/StationCode/${source}/`; + + +var datastd; +var usedata; +const callexternalapi = (callback) => +{ + + request(_External_URL , {json: true}, (err,res,body) => { + if(err) + { + console.log(err); + } + else + { + + + // datastd = JSON.stringify(body); + // usedata = JSON.parse(datastd); + const variableName = body; + var trainnumberlist = []; + var k=0; + // console.log(variableName.Trains.length); + for(var i=0;i { + if(err) + { + console.log(err); + } + else + { + console.log(body); + } + }) + } + + } +}) + +} +callexternalapi(); + + +}); + +module.exports = router; \ No newline at end of file From 0d153b9ab0024edca3de756506198d07cd605342 Mon Sep 17 00:00:00 2001 From: Anuj Pillai <56990215+anuj-2001@users.noreply.github.com> Date: Sun, 21 Feb 2021 16:46:57 +0530 Subject: [PATCH 5/9] Update --- auth.js | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/auth.js b/auth.js index acb079a..34b174a 100644 --- a/auth.js +++ b/auth.js @@ -64,11 +64,66 @@ const callexternalapi = (callback) => } else { - console.log(body); + const variabletrainstation = body.Route; + // console.log(variabletrainstation); + const dist = variabletrainstation[variabletrainstation.length-1].Distance; + console.log(dist); + + var lowestdistance = (dist*0.4); + var maximumdistance = (dist*0.7); + var possiblestation = []; + var possiblestationtime = []; + var mm=0; + for(var m = 0 ; m< variabletrainstation.length; m++) + { + if(variabletrainstation[m].Distance >= lowestdistance && variabletrainstation[m].Distance <= maximumdistance) + { + possiblestation[mm]=variabletrainstation[m].StationCode; + var timefirst = variabletrainstation[m].ArrivalTime; + var timesecond = variabletrainstation[m].DepartureTime; + + var af = timefirst.split(':'); // split it at the colons + var bf = timesecond.split(':'); + var minutesfirst = (+af[0]) * 60 + (+af[1]); + var minutesecond = (+bf[0]) * 60 + (+bf[1]); + + + + possiblestationtime[mm] = (minutesecond-minutesfirst); + mm++; + } + } + for (var inn=0; inn < mm-1; inn++) + { + // Last i elements are already in place + for ( var jn = 0; jn < mm-inn-1; jn++) + { + if (possiblestationtime[jn] > possiblestationtime[jn+1]) + { + var temp = possiblestationtime[jn]; + possiblestationtime[jn] = possiblestationtime[jn+1]; + possiblestationtime[jn+1]=temp; + + + var tempn = possiblestation[jn]; + possiblestation[jn] = possiblestation[jn+1]; + possiblestation[jn+1]=tempn; + // swap(&arr[j], &arr[j+1]); + } + + } + } + console.log(possiblestation); + console.log(possiblestationtime); + + + + // console.log(body.Route[]); } }) } - + + } }) From 8861628a52b21c506f5fff826d407547b4fc30ae Mon Sep 17 00:00:00 2001 From: Anuj Pillai <56990215+anuj-2001@users.noreply.github.com> Date: Sun, 21 Feb 2021 21:13:31 +0530 Subject: [PATCH 6/9] Last Few Commits --- auth.js | 241 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 125 insertions(+), 116 deletions(-) diff --git a/auth.js b/auth.js index 34b174a..94cc470 100644 --- a/auth.js +++ b/auth.js @@ -4,133 +4,142 @@ const bcrypt = require('bcryptjs') const request = require('request'); const { json } = require('express'); - - router.post('/check',function(req,res) { - - - // var searchh = req.body.trainnumber; - var source = req.body.from; - var destination = req.body.to; - console.log(source); - console.log(destination); - // res.send(source + destination); - -_External_URL = `https://indianrailapi.com/api/v2/AllTrainOnStation/apikey/72a4b65e030c0f6316343d8564fe3e34/StationCode/${source}/`; - - -var datastd; -var usedata; -const callexternalapi = (callback) => -{ - - request(_External_URL , {json: true}, (err,res,body) => { - if(err) - { + var source = req.body.from; + var destination = req.body.to; + console.log(source); + console.log(destination); + + _External_URL = `https://indianrailapi.com/api/v2/AllTrainOnStation/apikey/72a4b65e030c0f6316343d8564fe3e34/StationCode/${source}/`; + request(_External_URL , {json: true}, (err,res,body) => { + if(err) + { console.log(err); + } + else + { + const trainsFromStation = body; + var trainnumberlist = []; + var k=0; + for(var i=0;i { + if(err1) + { + console.log(err); + } + else { - if(variableName.Trains[i].Destination== destination) + const trainStationsList = body1.Route; + var soudis; + var destdis; + for(var qq=0;qq { - if(err) + if(trainStationsList[qq].StationCode == source) { - console.log(err); + soudis =trainStationsList[qq].Distance; } - else + if(trainStationsList[qq].StationCode == destination) { - const variabletrainstation = body.Route; - // console.log(variabletrainstation); - const dist = variabletrainstation[variabletrainstation.length-1].Distance; - console.log(dist); - - var lowestdistance = (dist*0.4); - var maximumdistance = (dist*0.7); - var possiblestation = []; - var possiblestationtime = []; - var mm=0; - for(var m = 0 ; m< variabletrainstation.length; m++) - { - if(variabletrainstation[m].Distance >= lowestdistance && variabletrainstation[m].Distance <= maximumdistance) - { - possiblestation[mm]=variabletrainstation[m].StationCode; - var timefirst = variabletrainstation[m].ArrivalTime; - var timesecond = variabletrainstation[m].DepartureTime; - - var af = timefirst.split(':'); // split it at the colons - var bf = timesecond.split(':'); - var minutesfirst = (+af[0]) * 60 + (+af[1]); - var minutesecond = (+bf[0]) * 60 + (+bf[1]); - - - - possiblestationtime[mm] = (minutesecond-minutesfirst); - mm++; - } - } - for (var inn=0; inn < mm-1; inn++) - { - // Last i elements are already in place - for ( var jn = 0; jn < mm-inn-1; jn++) - { - if (possiblestationtime[jn] > possiblestationtime[jn+1]) - { - var temp = possiblestationtime[jn]; - possiblestationtime[jn] = possiblestationtime[jn+1]; - possiblestationtime[jn+1]=temp; - - - var tempn = possiblestation[jn]; - possiblestation[jn] = possiblestation[jn+1]; - possiblestation[jn+1]=tempn; - // swap(&arr[j], &arr[j+1]); - } - - } - } - console.log(possiblestation); - console.log(possiblestationtime); - + destdis = trainStationsList[qq].Distance; + } + } - - // console.log(body.Route[]); + var dist = parseInt(destdis) - parseInt(soudis); + console.log(dist); + var lowestdistance = (dist*0.4)+parseInt(soudis); + var maximumdistance = (dist*0.7) + parseInt(soudis); + var possiblestation = []; + var possiblestationtime = []; + var mm=0; + for(var m = 0 ; m< trainStationsList.length; m++) + { + if(trainStationsList[m].Distance >= lowestdistance && trainStationsList[m].Distance <= maximumdistance) + { + possiblestation[mm]=trainStationsList[m].StationCode; + var timefirst = trainStationsList[m].ArrivalTime; + var timesecond = trainStationsList[m].DepartureTime; + var af = timefirst.split(':'); // split it at the colons + var bf = timesecond.split(':'); + var minutesfirst = (+af[0]) * 60 + (+af[1]); + var minutesecond = (+bf[0]) * 60 + (+bf[1]); + possiblestationtime[mm] = (minutesecond-minutesfirst); + mm++; } - }) - } - - + } + for (var inn=0; inn < mm-1; inn++) + { + for ( var jn = 0; jn < mm-inn-1; jn++) + { + if (possiblestationtime[jn] > possiblestationtime[jn+1]) + { + var temp = possiblestationtime[jn]; + possiblestationtime[jn] = possiblestationtime[jn+1]; + possiblestationtime[jn+1]=temp; + + var tempn = possiblestation[jn]; + possiblestation[jn] = possiblestation[jn+1]; + possiblestation[jn+1]=tempn; + } + } + } + console.log(possiblestation); + console.log(possiblestationtime); + for(var stt = mm-1;stt>=0;stt--) + { + var findtrain = possiblestation[stt]; + for(var ilt=0;ilt { + if(err2) + { + console.log(err2); + } + else + { + const trainsFromMid = body2; + const trainsmidlist=[]; + var s=0; + for(var ilt1=0;ilt1 Date: Sun, 21 Feb 2021 21:59:25 +0530 Subject: [PATCH 7/9] Update Readme.md --- Readme.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Readme.md b/Readme.md index 2107e6f..379b75d 100644 --- a/Readme.md +++ b/Readme.md @@ -1 +1,17 @@ Theme : Travelling + +API's USED : +https://indianrailapi.com/api/v2/AllTrainOnStation +https://indianrailapi.com/api/v2/TrainSchedule + +*PROBLEM STATEMENT* +Whenever we are in a rush to visit any place, often the primary approach to most of the Indian community would be railways. Railways provide decent services at reduced costs which is more preferable compared to any other means of transport. But, what if the buffer time between booking tickets and the actual date of train travel is less than a week? That's where the problem starts, in such situations, you cannot find a suitable direct point-to-point train that picks you from your city and drops you at the desired location. Such trains usually have their tickets sold out if you check a week before the scheduled travel day. + +*SOLUTION* + +When you don't find a suitable direct train from your source to your destination, you pick a station in between and try to find trains till that point and from there to your final destination. We designed an algorithm that helps you pick a station in between the source and destination. Considering that station we find trains that go till the station and from the station to your final destination. + + +*Working* + +The algorithm takes two inputs from the user i.e the station code of his/her source and destination. From these inputs, we find that long train's route whose tickets would be most probably sold out. We monitor the stop time of this train at each platform and then determine a station to be vast if it has a larger stop time. Optimizing furthermore, we select only such stations that fall under 40%-70% of the total distance so that a station nearer to the source or destination is not selected. From here on we get to find the trains that let us reach the middle station selected with the algorithm and give us suitable options to get there easily, saving time. From 9ef33aa01f934100b711841fd188c601067e6e54 Mon Sep 17 00:00:00 2001 From: Anuj Pillai <56990215+anuj-2001@users.noreply.github.com> Date: Sun, 21 Feb 2021 21:59:45 +0530 Subject: [PATCH 8/9] Add files via upload --- app.js | 106 --------------------------------------------------------- 1 file changed, 106 deletions(-) diff --git a/app.js b/app.js index 83647e0..2d469c0 100644 --- a/app.js +++ b/app.js @@ -4,13 +4,6 @@ const hbs = require('hbs'); const bodyparser = require('body-parser'); const app =express(); const path = require('path'); -// const { url } = require('inspector'); -// const fs = require('fs'); - - - - -// var railway = require('railway-api') const port = process.env.PORT || 3000; app.use(bodyparser.json()); @@ -21,114 +14,15 @@ app.use(express.static(path.join(__dirname,'public'))); app.set('views',path.join(__dirname,'templates/views')); app.set('view engine','hbs'); - - app.use(express.urlencoded({extended: true})); app.use(express.json()); -// app.use(app.router); -// routes.initialize(app); - -// app.use('/',require('./routes/pages')); - app.get('/', function(req,res){ // res.render('index'); res.render('homescreen') }); app.use('/auth',require('./routes/auth')); -// app.get('/', function(req,res){ -// // res.render('index'); -// res.render('homescreen') -// }); - -// railway.setApikey('72a4b65e030c0f6316343d8564fe3e34') -// railway.checkPnr('<10 digit pnr>', function (err, res) {}) -// railway.name_number(req.body.trainnumber, function (err, res) { - -// console.log(res); -// }) - -// var krdosex ="h"; -// app.post('/check',function(req,res) -// { - - -// // var searchh = req.body.trainnumber; -// var source = req.body.from; -// var destination = req.body.to; -// console.log(source); -// console.log(destination); -// // res.send(source + destination); - -// _External_URL = `https://indianrailapi.com/api/v2/AllTrainOnStation/apikey/72a4b65e030c0f6316343d8564fe3e34/StationCode/${source}/`; - - -// var datastd; -// var usedata; -// const callexternalapi = (callback) => -// { - -// request(_External_URL , {json: true}, (err,res,body) => { -// if(err) -// { -// console.log(err); -// } -// else -// { - -// // datastd = JSON.stringify(body); -// // usedata = JSON.parse(datastd); -// const variableName = body; -// module.exports = variableName; -// // krdosex = `${usedata.Trains[0].TrainNo}`; -// // console.log(variableName); -// // console.log(usedata.Trains[0].TrainNo); -// // fs.writeFile("json.json",datastd,(err)=> -// // { -// // console.log("done"); -// // }) -// // console.log(datastd); -// // res.send(body); -// } -// }) - - -// } -// callexternalapi(); - - -// }); -// // console.log(krdosex); - - -// // } -// // var datatrain=''; -// // var searchh = req.body.from; -// // const options = { -// // method: 'POST', -// // url: 'https://trains.p.rapidapi.com/', -// // headers: { -// // 'content-type': 'application/json', -// // 'x-rapidapi-key': '11d26b13d3msh0c0e1f0eafa7297p1584a8jsn4c256b77a0d2', -// // 'x-rapidapi-host': 'trains.p.rapidapi.com', -// // useQueryString: true -// // }, -// // body: {search: searchh}, -// // json: true -// // }; - -// // request(options, function (error, response, body) { -// // if (error) throw new Error(error); - -// // console.log(body); -// // datatrain=body; -// // // res.send(body); -// // }); -// // res.send(datastd); -// // }) - - app.listen(port,()=>{ console.log(`servewr is on port ${port}`); From 94bd232f7098ce3d8cabaf3ad9b6f7b745845a22 Mon Sep 17 00:00:00 2001 From: Anuj Pillai <56990215+anuj-2001@users.noreply.github.com> Date: Sun, 21 Feb 2021 22:01:21 +0530 Subject: [PATCH 9/9] Update Readme.md --- Readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Readme.md b/Readme.md index 379b75d..f0b2050 100644 --- a/Readme.md +++ b/Readme.md @@ -2,9 +2,11 @@ Theme : Travelling API's USED : https://indianrailapi.com/api/v2/AllTrainOnStation + https://indianrailapi.com/api/v2/TrainSchedule *PROBLEM STATEMENT* + Whenever we are in a rush to visit any place, often the primary approach to most of the Indian community would be railways. Railways provide decent services at reduced costs which is more preferable compared to any other means of transport. But, what if the buffer time between booking tickets and the actual date of train travel is less than a week? That's where the problem starts, in such situations, you cannot find a suitable direct point-to-point train that picks you from your city and drops you at the desired location. Such trains usually have their tickets sold out if you check a week before the scheduled travel day. *SOLUTION*