Implement environment variable setup for frontend; create .env.production and .env.development files if they don't exist, and update API URLs in frontend components to use dynamic API_BASE_URL for improved configuration management.

This commit is contained in:
Torsten Schulz (local)
2025-10-18 23:36:31 +02:00
parent b066ffdeb4
commit efbb699b4b
25 changed files with 577 additions and 41 deletions

View File

@@ -212,7 +212,7 @@ const form = ref({
// Lade alle Bundesländer
async function loadStates() {
try {
const response = await fetch('http://localhost:3010/api/holidays/states', {
const response = await fetch('${API_URL}/holidays/states', {
headers: {
'Authorization': `Bearer ${authStore.token}`
}
@@ -233,7 +233,7 @@ async function loadStates() {
async function loadHolidays() {
try {
loading.value = true
const response = await fetch('http://localhost:3010/api/holidays', {
const response = await fetch('${API_URL}/holidays', {
headers: {
'Authorization': `Bearer ${authStore.token}`
}
@@ -276,7 +276,7 @@ async function createHoliday() {
try {
loading.value = true
const response = await fetch('http://localhost:3010/api/holidays', {
const response = await fetch('${API_URL}/holidays', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -318,7 +318,7 @@ async function deleteHoliday(id) {
try {
loading.value = true
const response = await fetch(`http://localhost:3010/api/holidays/${id}`, {
const response = await fetch(`${API_URL}/holidays/${id}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${authStore.token}`