/flights_api

express-mongo-heroku-flights-api

Primary LanguageJavaScript


Logo

Flights Management API

An awesome API made for managing company employees flights
Explore the API docs »

API Endpoint · Report Bug · Request Feature

Table of Contents

About The Project

This project implements flight management API

Here's list of the main functionalities:

  • Sign up to get API key
  • Get weather on destination country/city of flight
  • Preform CRUD operations on the flights dataset

The API is published on heroku in the following address : https://employees-flight-api.herokuapp.com

Built With

Getting Started

To get a local copy up and running follow these simple example steps.

Installation

  1. Clone the repo Open in Visual Studio Code
git clone https://github.com/DCS-Shenkar-2022/assignment9---ex2-express-mongo-heroku-OferElfassi.git
  1. Install NPM packages
npm install
  1. Add .env file and write your credentials
DB_NAME= "********"
DB_USER= "********"
DB_PASS= "********"
DB_HOST= "********"
WEATHER_API_KEY= "********"

Usage

In order to use the demo API use the following endpoint - https://employees-flight-api.herokuapp.com

Here's example call to the API:

GET: Get flight by id (Using AJAX)

var settings = {
    "url": "https://employees-flight-api.herokuapp.com/api/flights/61a74684faab93f0ec373026",
    "method": "GET",
    "timeout": 0,
    "headers": {
        "Authorization": "C86B2FC2"
    },
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Response (JSON)

{
    "message": "Flights found successfully.",
        "data": {
        "dest": "Great Falls",
            "date": "2022-02-15T09:20:34.283Z",
            "weather": {
            "sky": "overcast clouds",
                "humidity": 51,
                "temp": "13.92 c"
        }
    }
}

For more examples, please refer to the Documentation

Contact

Ofer Elfassi - @Linkedin - ofer2212@gmail.com

Project Link: https://github.com/DCS-Shenkar-2022/assignment9---ex2-express-mongo-heroku-OferElfassi