December 2020
🔨 Pokédex made with Svelte using Pokémon API.
From Udemy: Svelte de A à Z
Applcation that fetches a Pokémon API.
It displays Pokémons by name (in French) and display an image of the creature.
Tip: disable autosave when you work with api, otherwise it will make tons of not useful request.
npm installnpm run devnpm install -D gh-pages"scripts": {
"dev": "sapper dev",
"build": "sapper build --legacy",
"export": "sapper export --legacy",
"start": "node __sapper__/build",
"deploy": "sapper export --legacy && gh-pages -d __sapper__/export"
},
npm run deployheroku loginheroku create my-appgit push heroku HEAD:masterUse :
import { onMount } from 'svelte'
onMount(async () => {
const fetchPokemonBase = () => {
fetch('https://pokeapi.co/api/v2/pokemon/?limit=151')
// ...
});