🔧 create backend connector
create a connector to communicate with the backend service using the ky module.
This commit is contained in:
@ -1,8 +1,9 @@
|
|||||||
APP_NAME="Astofo TV"
|
APP_NAME="Syzne TV"
|
||||||
APP_ENV="development"
|
APP_ENV="development"
|
||||||
APP_DOMAIN=
|
APP_DOMAIN=
|
||||||
APP_PORT=3000
|
APP_PORT=3000
|
||||||
|
|
||||||
MAIN_BACKEND_API_URL=
|
MAIN_BACKEND_API_URL=
|
||||||
|
MAIN_BACKEND_API_KEY=
|
||||||
API_KEY=
|
API_KEY=
|
||||||
JWT_TOKEN=
|
JWT_TOKEN=
|
||||||
3
bun.lock
3
bun.lock
@ -10,6 +10,7 @@
|
|||||||
"commitizen": "^4.3.1",
|
"commitizen": "^4.3.1",
|
||||||
"cz-emoji": "^1.3.2-canary.2",
|
"cz-emoji": "^1.3.2-canary.2",
|
||||||
"framer-motion": "^12.23.3",
|
"framer-motion": "^12.23.3",
|
||||||
|
"ky": "^1.8.2",
|
||||||
"next": "15.3.5",
|
"next": "15.3.5",
|
||||||
"next-themes": "^0.4.6",
|
"next-themes": "^0.4.6",
|
||||||
"nextjs-toploader": "^3.8.16",
|
"nextjs-toploader": "^3.8.16",
|
||||||
@ -1082,6 +1083,8 @@
|
|||||||
|
|
||||||
"keyv": ["keyv@4.5.4", "", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="],
|
"keyv": ["keyv@4.5.4", "", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="],
|
||||||
|
|
||||||
|
"ky": ["ky@1.8.2", "", {}, "sha512-XybQJ3d4Ea1kI27DoelE5ZCT3bSJlibYTtQuMsyzKox3TMyayw1asgQdl54WroAm+fIA3ZCr8zXW2RpR7qWVpA=="],
|
||||||
|
|
||||||
"language-subtag-registry": ["language-subtag-registry@0.3.23", "", {}, "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ=="],
|
"language-subtag-registry": ["language-subtag-registry@0.3.23", "", {}, "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ=="],
|
||||||
|
|
||||||
"language-tags": ["language-tags@1.0.9", "", { "dependencies": { "language-subtag-registry": "^0.3.20" } }, "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA=="],
|
"language-tags": ["language-tags@1.0.9", "", { "dependencies": { "language-subtag-registry": "^0.3.20" } }, "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA=="],
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
"commitizen": "^4.3.1",
|
"commitizen": "^4.3.1",
|
||||||
"cz-emoji": "^1.3.2-canary.2",
|
"cz-emoji": "^1.3.2-canary.2",
|
||||||
"framer-motion": "^12.23.3",
|
"framer-motion": "^12.23.3",
|
||||||
|
"ky": "^1.8.2",
|
||||||
"next": "15.3.5",
|
"next": "15.3.5",
|
||||||
"next-themes": "^0.4.6",
|
"next-themes": "^0.4.6",
|
||||||
"nextjs-toploader": "^3.8.16",
|
"nextjs-toploader": "^3.8.16",
|
||||||
|
|||||||
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