ghost-listmonk-connector/ui/lib/api-client.ts
troneras 1fd7dad8e4 # This is a combination of 2 commits.
# This is the 1st commit message:

first commit

# This is the commit message #2:

fixed cache
2024-08-21 02:08:01 +02:00

14 lines
No EOL
471 B
TypeScript

// src/lib/api-client.ts
import axios from 'axios';
const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:8808';
const API_KEY = process.env.NEXT_PUBLIC_API_KEY || "your-api-key";
export const apiClient = axios.create({
baseURL: API_BASE_URL.replace(/\/$/, ''), // Remove trailing slash if present
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${API_KEY}`,
},
withCredentials: true,
});