15 lines
418 B
TypeScript
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();
|
|
},
|
|
};
|