Skip to content

apetorgboe/6003CEM-CourseworkCodio

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
.vs
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Weather API

Installation

First install dependencies:

npm install

Setting Up MongoDB

  1. Create MongoDB Database:

    • Make sure MongoDB is installed and running.
    • Create a database named weather.
    • Optionally, create a collection named test within the weather database.
  2. Create .env File:

    • Create a .env file in the root directory of your project.
    • Add the following configuration to the .env file:
    OPENWEATHERMAP_API_KEY=b31583c910d30e7cd9b162d25e1d3793
    MONGO_URI=mongodb://localhost:27017/weather
    # Make a database in MongoDB called weather and add the collection called test if needed
    # Add the connection string to the .env file

    Replace b31583c910d30e7cd9b162d25e1d3793 with your actual OpenWeatherMap API key.

Running the Server

To start the server, run:

npm run start

The server will start at http://localhost:3000.

API Documentation

After starting the server, access the API documentation at:

http://localhost:3000/docs

This documentation is generated using Swagger UI and provides details on the available endpoints and how to use them.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published