DEV Community

Discussion on: Headless WordPress with Sapper (Part 1)

 
shriji profile image
Shriji

Thanks, I think permalinks will create unique slugs.

Pls try and let me know. I am glad you find this post helpful.

Thread Thread
 
anilbhattaraitoronto profile image
Anil Bhattarai

I could get the request on the browser but not through the sapper page.

Thread Thread
 
shriji profile image
Shriji

That's odd, what seems to be the error?

Thread Thread
 
anilbhattaraitoronto profile image
Anil Bhattarai

I saw that the json that I received was an array, not a single object. Therefore, I did iterate for arr[0] to get that single object.

Thread Thread
 
anilbhattaraitoronto profile image
Anil Bhattarai

In the [slug] page I did this: return { post: data[0] };

Thread Thread
 
shriji profile image
Shriji

Yes that is right, I have covered it in the next post there are 5 parts right now.

Also I have pushed my repo github.com/peopledrivemecrazy/Sapp...