Skip to content

Jason-bolt/WeatherApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INCIDENT REPORTING

This is an API that stores an incident and displays it when queried.


The API has two endpoints, a GET /incidents endpoint and a POST /report endpoint.

When the GET request is called, the API fetches data from the incidents table of the postgreSQL database ElephantSQL and displays in json format, the data for to the user.

With the POST request, the user must send a body along with the request, preferrably in json format. The body sent by the user is then validated, top ensure the right values were sent. After validation, the city field of the body data is added to an external weather api to get the current weather at that location. The current date and weather are added to the body data and sent to the database.


Technologies Used

  • NodeJS
  • Express
  • PostgreSQL

How to run test in development

Download the repo to your local machine and run the following commands.

- npm install
- npm run dev (For development mode)
- npm run start (For production mode)

You are however supposed to provide a database URI, weather API key and PORT number in a .env file.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published