My dev server is :
and production server is:
When I make the request in dev mode I get a console error,
http://localhost:8000/wp-json/wp/v2/posts 403 (Forbidden)
This is confirmed when I print out wpApiSettings.root. It shows as,
wpApiSettings.root = 'http://localhost:8000/wp-json/
Is there a config variable I can access to detect when I am using the dev server so that I can change wpApiSettings.root to the dev sever?