first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:04:35 +03:00
commit 763b147cc3
199 changed files with 29356 additions and 0 deletions

12
test-image-url.js Normal file
View File

@@ -0,0 +1,12 @@
// Test getImageUrl function
const BASE_API_URL = 'http://127.0.0.1:8000'\;
const getImageUrl = (imagePath) => {
if (!imagePath) return '/assets/images/work/placeholder.jpg'
if (imagePath.startsWith('http')) return imagePath
return `${BASE_API_URL}${imagePath}`
}
// Test cases
console.log('Test 1 - API path:', getImageUrl('/media/uploads/portfolio/a2afc48f6532427cac863619563e3800.avif'));
console.log('Test 2 - Full URL:', getImageUrl('http://example.com/image.jpg'));
console.log('Test 3 - Null:', getImageUrl(null));
console.log('Test 4 - Empty:', getImageUrl(''));