deployment-docs

Advanced Front End | React (PP5) : Applying your deployed API

Update your React project with the new API URL.


If the original version of your React project used an API that was deployed to Heroku: You will first need to migrate your API project from Heroku to Render. If you have not already migrated your API, please follow the steps to do so, starting with Advanced Front End | DRF (PP5) : Create a database.

Process

  1. In src/api/axiosDefaults.js, update your baseURL to the url of your Render API project

    For example:
    updated line of code reading axios.defaults.baseURL = 'https://drf-api-34kw.onrender.com';

  2. In src/mocks/handlers.js, also update your baseURL to the url of your Render API project

    For example:
    updated line of code reading const baseURL = 'https://drf-api-34kw.onrender.com';

  3. Git add, commit and push all changes to GitHub

Up Next

Now your project is ready for deployment. As this is a React project, the steps to deploy a static site are next.