Init
This commit is contained in:
commit
c048377bcc
32 changed files with 4748 additions and 0 deletions
17
frontend/src/api/client.ts
Normal file
17
frontend/src/api/client.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import axios from 'axios';
|
||||
import { CreateLinkRequest, Link } from '../types/api';
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: '/api',
|
||||
});
|
||||
|
||||
export const createShortLink = async (data: CreateLinkRequest) => {
|
||||
const response = await api.post<Link>('/shorten', data);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const getAllLinks = async () => {
|
||||
const response = await api.get<Link[]>('/links');
|
||||
return response.data;
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue