feat: initial frontend commit
This commit is contained in:
parent
6612ed6df6
commit
e1cdb7af79
18 changed files with 4146 additions and 0 deletions
14
modules/frontend/src/services/api.ts
Normal file
14
modules/frontend/src/services/api.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import axios from "axios";
|
||||
|
||||
const API_BASE_URL = import.meta.env.VITE_BACKEND_API_BASE_URL;;
|
||||
|
||||
export interface Item {
|
||||
id: number;
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export const fetchItems = async (): Promise<Item[]> => {
|
||||
const response = await axios.get<Item[]>(`${API_BASE_URL}/api`);
|
||||
return response.data;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue