Giter Club home page Giter Club logo

dotnetweatherapi's Introduction

Weather Forecasting API

Bienvenue dans WeatherApi, un projet ASP.NET Core 8 permettant d'interagir avec une API météo tierce.

Configuration (sans Docker)

  1. Cloner et variables d'environnement

    git clone https://github.com/Macktireh/DotnetWeatherApi.git
    
    cd DotnetWeatherApi
    

    Copiez le fichier .env.example en tant que .env et renseignez les valeurs appropriées pour les clés API météo.

    WEATHER_API_URL=
    WEATHER_API_KEY=
    
  2. Assurez-vous que les variables d'environnement WEATHER_API_URL et WEATHER_API_KEY sont définies.

sans Docker

  1. Installez les dépendances nécessaires avec la commande :

    dotnet restore
  2. Lancez l'application avec la commande :

    dotnet run

avec Docker

  1. Construisez et lancez l'application avec Docker en utilisant la commande :

    docker compose

    docker-compose up --build

    docker only

    docker run --name weatherapi -p 8080:8080 -p 8081:8081 -e WEATHER_API_URL=YOUR_WEATHER_API_URL -e WEATHER_API_KEY=YOUR_WEATHER_API_KEY macktireh/weatherapi:1.0 

    ou

    docker run --name weatherapi -p 8080:8080 -p 8081:8081 --env-file .env macktireh/weatherapi:1.0 
  2. Accédez à Swagger pour explorer les endpoints de l'API :

    http://localhost:8080/swagger

Endpoints

Recherche de lieux

Endpoint : /api/search

Prévisions météo

Endpoint : /api/forecast

  • Méthode : GET
  • Paramètres :
    • q (obligatoire) : La requête de recherche.
    • days (facultatif) : Le nombre de jours de prévisions (par défaut, 3).
    • lang (facultatif) : La langue de la réponse (par défaut, "en").
  • Exemple : http://localhost:5000/api/forecast?q=Paris

dotnetweatherapi's People

Contributors

macktireh avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.