Site icon Hip-Hop Website Design and Development

WP Rest API convert permalink to post ID for get

I’m during the time spent changing over my current WordPress site to utilize Preact/Redux on the frontend and utilize the WP REST API to get post information back from the admin.

I’ll utilize React Router and a revamp in .htaccess to modify the URLs to the index.html document, and React Router should deal with the requests.

Given a current URL of https://peteschuster.com/2017/10/high-acclaim respond environment/ I accept I’ll arrangement my course as /:year/:month/:slug

My question is, how might I utilize those params to get the post ID so I can call the REST endpoint for: GET/wp/v2/posts/<id>?

Perhaps there is another approach to accomplish this? I attempted a few blends of:

https://peteschuster.com/wp/v2/posts/2017/10/high-acclaim respond biological system/ without much of any result. I was figuring it very well may be conceivable like how /feed is taken care of like:

https://peteschuster.com/2017/10/high-acclaim respond biological system/json

Any direction would be enormously refreshing. Thanks!