You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
720 B

import axios from 'axios';
import config from '../../config.json';
export const getProjects = async () => {
const { data } = await axios.get(
`https://api.github.com/users/${config.social.github}/repos`,
);
return data;
};
export const getReadme = async () => {
const { data } = await axios.get(config.readmeUrl);
return data;
};
export const getWeather = async (city: string) => {
try {
const { data } = await axios.get(`https://wttr.in/${city}?ATm`);
return data;
} catch (error) {
return error;
}
};
export const getQuote = async () => {
const { data } = await axios.get('http://api.quotable.io/random');
return {
quote: `${data.content}” — ${data.author}`,
};
};