Skip to content

Instantly share code, notes, and snippets.

@Deepak13245
Last active May 24, 2020 16:26
Show Gist options
  • Save Deepak13245/a4da71679264054f675c6f13806a3ef2 to your computer and use it in GitHub Desktop.
Save Deepak13245/a4da71679264054f675c6f13806a3ef2 to your computer and use it in GitHub Desktop.
Weather API connector
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