Files
feladat4mobil/services/api.ts
2026-02-25 09:16:11 +01:00

15 lines
418 B
TypeScript

export const apiService = {
getUsers: async () => {
const res = await fetch('https://jsonplaceholder.typicode.com/users');
return res.json();
},
getPosts: async () => {
const res = await fetch('https://jsonplaceholder.typicode.com/posts');
return res.json();
},
getTodos: async () => {
const res = await fetch('https://jsonplaceholder.typicode.com/todos');
return res.json();
},
};