Skip to content

API Service

This file contains the configuration for the Axios instance used to make HTTP requests throughout the application.

Configuration Details

Base URL

The base URL for the API is determined dynamically:

  • Environment variable: VITE_APP_BACKEND_URL
  • Fallback: ${window.location.origin}/api

Axios Instance

The Axios instance is configured with the following properties:

  • baseURL: The base URL for all requests.
  • headers:
  • Content-Type: application/json
  • withCredentials: true (to include cookies in cross-origin requests).

Usage

The configured Axios instance is exported as the default export and can be used to make HTTP requests in other modules.