add header

This commit is contained in:
smanylov
2025-11-26 14:01:35 +07:00
parent 7a8c2cee56
commit ebca795c1b
16 changed files with 618 additions and 41 deletions
+14
View File
@@ -1,5 +1,19 @@
'use server'
const FRUITS_URL = 'https://www.fruityvice.com/api/fruit/';
const ALL = 'all'
export async function fetchFruits() {
try {
const response = await fetch(FRUITS_URL + ALL, { 'method': 'GET' });
let parsed = await response.json();
return parsed;
} catch (error) {
console.error('Error:', error);
throw new Error('Failed to fetch fruits data.');
}
}
export async function testConnect() {
try {
const response = await fetch('http://localhost:8080/api/auth/register', {