Fetching The Posts
In this first part of the 'Creating Svelte, Sapper and WordPress Website' series we are going to connect to our WordPress API to fetch the posts and display them on our homepage
In this series I’m going to shoow you how to create a headless website using Sapper framework that is based on Svelte. We have already taken a brief look at the Sapper framework, but in this series we are gonna take a deep dive into the framework and try to create a fully functioning headless web site using WordPress as our backend and Svelte and Sapper as our frontend.
In this first episode we are going to connect to our WP REST API and fetch the posts from it. Then we are going to display them in our Svelte app.