create a connector to communicate with the backend service using the ky module.
12 lines
215 B
TypeScript
12 lines
215 B
TypeScript
"use server";
|
|
|
|
import ky from "ky";
|
|
|
|
export const api = ky.create({
|
|
prefixUrl: process.env.MAIN_BACKEND_API_URL,
|
|
credentials: "include",
|
|
headers: {
|
|
access_token: process.env.MAIN_BACKEND_API_KEY,
|
|
},
|
|
});
|