🔧 create backend connector
create a connector to communicate with the backend service using the ky module.
This commit is contained in:
11
shared/api/connector.ts
Normal file
11
shared/api/connector.ts
Normal file
@ -0,0 +1,11 @@
|
||||
"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,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user