Skip to content

Commit

Permalink
Create apiConfig.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Nov 25, 2024
1 parent 13bc759 commit 95937ff
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/config/apiConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// API configuration settings
const apiConfig = {
baseUrl: process.env.API_BASE_URL || 'https://api.example.com',
apiKey: process.env.API_KEY || 'your-api-key',
timeout: process.env.API_TIMEOUT || 5000, // Timeout in milliseconds
};

// Function to get headers for API requests
function getApiHeaders() {
return {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiConfig.apiKey}`,
};
}

module.exports = { apiConfig, getApiHeaders };

0 comments on commit 95937ff

Please sign in to comment.