Description • How To Run • Unit Test • Live Demo •
Simple API Application for the Wizeline Golang Bootcamp
To clone and run this application, you'll need Git, python3.6+(https://nodejs.org/en/download/), python3-pip and flask 1.1.2+ installed on your computer. You will also need to register and obtain an API key from: https://openweathermap.org/api
From your command line run:
# Clone this repository
$ git clone https://github.com/deuspaul/paulf-wlgbc-api.git
# Go into the repository
$ cd paulf-wlgbc-api
# Create the file with the API Key
$ touch cred_wlgbc.py
apiKey = "<your api key>"
# Install required packages
$ pip3 install -r requirements.txt
# Run the app
$ export FLASK_APP=main.py
$ flask runThe unit test for this API is really simple, it just raises a type error in case the input for the get_cityweather function is not a string.
# Run the unit tests
$ python3 -m unittest test_main.pyTest Hello World endpoint: http://52.224.64.102:5000/ Test get_weather api endpoint: http://52.224.64.102:5000/weather/ for example: http://52.224.64.102:5000/weather/guadalajara