I'm developing both a REST API and a frontend web app. What's the best way to go about plugging the API into the web app while I'm developing locally on my machine?
I could spin up a local copy of the API and point my web app to
localhost:api-port, but that seems like unnecessary administrative work to have a local copy of both the API and web app running. Every time I want to do any development work I'll have to spin up the API, then spin up the web app.I could set up a remote dev environment and point my web app to
dev.api.mydomain.comfor local development, but it seems counter intuitive to have to set up a remote API sandbox to develop the web app locally.I could mock schemas and data with JSON files for local development. Instead of the web app doing a GET to
api.mydomain.comit'll just read./mock-data/some-resource.json. Seems like extra overhead to keep schemas and data matching production. Also wouldn't handle any logic that's built into the API on top of returning raw resources.
Best way forward?