less than 1 minute read

Introduction

Today, I worked on creating an API service in the React frontend to handle communication with the backend program

Development Notes

First of all, I downloaded the axios package to handle requests, and then added dependancies to package.json

Screenshot 2025-06-05 at 10 15 48 PM

I created an API service file to define API request and response types (basically the shape of data going in and out of the API)

Screenshot 2025-06-05 at 10 18 38 PM

Then, I created an axios instance with a default configuration

Screenshot 2025-06-05 at 10 19 10 PM

Finally, I created a method to take a classification request and promise to fetch a classification response with proper error handling

Screenshot 2025-06-05 at 10 21 20 PM

Next steps would be to work on creating a frontend form component where I can collect the request from the user, use the API service to call the classification request, and then display the results