Added PFM Console UI project

This commit is contained in:
2026-09-11 12:13:25 +02:00
parent a15b25248d
commit 99ab5b2ce6
35 changed files with 12231 additions and 0 deletions
@@ -0,0 +1,28 @@
import axios, { InternalAxiosRequestConfig } from 'axios';
import { getApiBaseUrl } from '../config';
export const BASE_API_URL = getApiBaseUrl();
// Create Axios Instance
export const apiClient = axios.create({
baseURL: BASE_API_URL,
headers: {
'Content-Type': 'application/json; version=1',
Accept: 'application/json; version=1',
},
timeout: 15000,
});
// Request Interceptor to dynamically set baseURL and attach Bearer Token
apiClient.interceptors.request.use(
(config: InternalAxiosRequestConfig) => {
// Dynamically synchronize baseURL from runtime configuration
config.baseURL = getApiBaseUrl();
const token = localStorage.getItem('pfm_access_token');
if (token && config.headers) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
},
(error) => Promise.reject(error)
);