RA
raniaSayed/Basic-Flights-Reservation-App-
NodeJs-MonogDB API single page application for booking flight seats.
Basic Flight Reservation API
NodeJs-MonogDB API single page application for booking flight seats.Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.Prerequisites (Used Technologies)
Node.js v8.10.0 or above
MongoDB database engine v3.6.3
Installation
To run App on Ububtu:
follow this commands$ sudo service mongod start
$ cd {project_folder}/
$ npm install
$ npm start
$ mongo
Execute this script on mongo shell
Add inital seats to system with this script
use fligth_reservation313;
let seats = [];
let chars = ["A","B","C","D","E","F"];
for(var i = 1 ;i < 11 ;i++){
for(var j = 0 ;j < 6 ;j++){
seats.push({_id:(i+chars[j]),available:true});
}
}
db.seats.insert(seats)
start app via https://localhost:9090/
To run App on Windows
Start mongoDB server :
mongod.exe --config="C:\mongodb\mongo.config"
Connect to localhost MongoDB server via command line
mongo --port 27017
open project directory
open cmd and type this commands
$ npm install
$ npm start
$ mongo
Execute this script on mongo shell
Add inital seats to system with this script
use fligth_reservation313;
let seats = [];
let chars = ["A","B","C","D","E","F"];
for(var i = 1 ;i < 11 ;i++){
for(var j = 0 ;j < 6 ;j++){
seats.push({_id:(i+chars[j]),available:true});
}
}
db.seats.insert(seats)
start app via https://localhost:9090/