Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

527 B
Raw Blame
import { createApp } from "../../../../apps/api/src/index";

export function projectAccessApi(headers: Record<string, string> = {}) {
  const { app } = createApp();
  return (path: string, init: { method?: string; body?: unknown } = {}) =>
    app.request(`/api${path}`, {
      method: init.method ?? "GET",
      headers: {
        "content-type": "application/json",
        origin: "http://localhost:5173",
        ...headers,
      },
      body: init.body === undefined ? undefined : JSON.stringify(init.body),
    });
}