This task's goal is to install Axios for making HTTP requests and create an API client to handle interactions with the backend. The API client will be used throughout the application for making network requests.
Tasks
Navigate to the forntend folder from your terminal with this command
cd frontend
Install Axios:
Install Axios using npm.
npm install axios
Create API Client:
Create a new file called apiClient.ts in the app/components directory.
Set up an Axios instance with a base URL and necessary headers.
Use the following base URL for the Axios instance: https://olikwzthj7.execute-api.us-east-1.amazonaws.com/dev.
Add meaningful comments when setting up the Axios instance.
Implement Interceptors:
Add interceptors to handle request and response globally.
Ensure to include authorization tokens in requests.
Handle errors globally, such as redirecting to login on 401 errors.
Additional Notes
Branch: Please create a new branch from development for your changes.
git checkout development
git pull origin development
git checkout -b feature/setup-axios
Feature Request: Set Up Axios API Client
Description
This task's goal is to install Axios for making HTTP requests and create an API client to handle interactions with the backend. The API client will be used throughout the application for making network requests.
Tasks
Navigate to the forntend folder from your terminal with this command
Install Axios:
Create API Client:
apiClient.ts
in theapp/components
directory.https://olikwzthj7.execute-api.us-east-1.amazonaws.com/dev
.Implement Interceptors:
Additional Notes
development
for your changes.