A simple website allows the user to get different pokemon's by ids.
The objective of the project is to practice using get requests and apply separation of concerns.
- JavaScript
- HTML5
- CSS3
- VSC code
- clone the repo.
npm install
const getPokemonById = async (id) => {
try {
const res = await fetch(`https://pokeapi.co/api/v2/pokemon/${id}`);
if (!res.ok) {
throw new Error(`An error has occurred: ${res.status}`);
}
const data = await res.json();
return data;
} catch (err) {
console.error('There was an error fetching the Pokémon:', err);
return null;
}
};
export default getPokemonById;
List of features ready and Todos for future development
To-do list:
Project is: in progress