feat(api): create base api using ky
This commit is contained in:
2
src/shared/config/api/endpoint.ts
Normal file
2
src/shared/config/api/endpoint.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export const BASE_URL =
|
||||
import.meta.env.VITE_API_BASE_URL || "https://localhost:3001";
|
||||
6
src/shared/config/api/httpClient.ts
Normal file
6
src/shared/config/api/httpClient.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import ky from "ky";
|
||||
import { BASE_URL } from "./endpoint";
|
||||
|
||||
export const api = ky.create({
|
||||
prefixUrl: BASE_URL,
|
||||
});
|
||||
2
src/shared/config/index.ts
Normal file
2
src/shared/config/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from "./api/endpoint";
|
||||
export * from "./api/httpClient";
|
||||
Reference in New Issue
Block a user