Yield generated for 4b21a850-3df7-4c43-8dd5-d0f5589c2401
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.
 

35 lines
708 B

import fastify from 'fastify';
import axios from 'axios';
const app = fastify({ logger: true });
app.get('/', async (req, res) => {
return {
catfacts: getCatFacts(),
foxes: getFoxDay(),
day: getDayOfCountry()
};
});
const getCatFacts = async(id) =>{
axios.get('https://cat-fact.herokuapp.com/facts/{id}').then(res => {});
};
const getFoxDay = async(id) =>{
axios.get('https://randomfox.ca/floof/').then(res => {});
};
const getDayOfCountry = async(id) =>{
axios.get('https://randomfox.ca/floof/').then(res => {});
};
const start = async () => {
try {
await app.listen(5000);
getCatFacts(1);
} catch (err) {
app.log.error(err);
process.exit(1);
}
};
start();