Last active
May 24, 2020 16:26
-
-
Save Deepak13245/a4da71679264054f675c6f13806a3ef2 to your computer and use it in GitHub Desktop.
Weather API connector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Axios from "axios"; | |
const connector = Axios.create({ | |
baseURL: "https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api" | |
}); | |
export const getWeatherByLocationId = async id => { | |
const { data } = await connector.get(`/location/${id}/`); | |
return data; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment