export const server = {
    async get(url: string) {
        const res = await fetch(url, { credentials: 'include' })
        return await res.json()
    },
    async post<T>(url: string, body?: T) {
        const res = await fetch(url, {
            method: 'POST',
            credentials: 'include',
            headers: {
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(body),
        })

        return await res.json()
    },
}
