Skip to content

codeHokage1/flightBookingApi_with_Mongoose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flight Booking API

This project implements CRUD concepts, follows the MVC software architecture to manage flight bookings and saves all data in a MongoDb cloud database.

Features:

  • A Schema, Model and Configuration to connect with MongoDB collection using Mongoose
  • Routes to carry out tasks:
    • /flights: to get all the flights booked
    • /flights/:id: to get, update and delete a specific flight by id

How to use:

  • Clone or download the repo
  • Run the code below to install all the node modules used:
npm install
  • Create a MongoDB account and a database collection
  • Create a .env file that contains the connection string
  • Modify the config/dbConfig.js file accordingly to use the connection string
  • While adding a new flight, the body of the POST request should be similar to:
{
    "title": "Flight to Bali",
    "time": "10am",
    "price": "250usd",
    "date": "12-12-2022"
}

The id and dateBooked are automatically generated.

  • Flight updates with PUT requests can be identical to the body of the POST request or with ommissions.

Tech/Tools Used:

  • JavaScript
  • NodeJS and NPM
  • Mongoose
  • Express
  • Nodemon
  • date-fns
  • Thunder Client

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors