Skip to content

Commit 07699f7

Browse files
committed
fix: base url prefix
1 parent 519adb3 commit 07699f7

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VITE_API_BASE_URL=/api
1+
VITE_API_BASE_URL=/mocks
22
VITE_API_MOCKING_ENABLED=true

.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VITE_API_BASE_URL=http://127.0.0.1:8000/api
1+
VITE_API_BASE_URL=http://127.0.0.1:3338
22
VITE_API_MOCKING_ENABLED=false

src/constants/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import meta from "@/constants/meta";
22

3-
export const API_URL = meta.apiMocksEnabled ? "" : meta.apiBaseUrl;
3+
export const API_URL = meta.apiBaseUrl;

src/constants/endpoints.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const INFO = "/info"
2-
const BALANCES = "/balances"
1+
const INFO = "/v1/info"
2+
const BALANCES = "/v1/balances"
33

44
export {
55
INFO,

src/lib/api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export interface InfoResponse {
77
version?: string
88
description?: string
99
description_long?: string
10-
"contact": {
11-
"method": string
12-
"info": string
10+
contact?: {
11+
method?: string
12+
info?: string
1313
}[],
1414
motd?: string
1515
icon_url?: string

src/mocks/handlers/info.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { http, delay, HttpResponse } from "msw"
2-
import { INFO } from "@/constants/endpoints"
2+
import { API_URL } from "@/constants/api"
33
import type { InfoResponse } from "@/lib/api"
4+
import { INFO } from "@/constants/endpoints"
45

5-
export const fetchInfo = http.get<never, never, InfoResponse>(INFO, async () => {
6+
export const fetchInfo = http.get<never, never, InfoResponse>(`${API_URL}${INFO}`, async () => {
67
await delay(1000)
78

89
return HttpResponse.json({

0 commit comments

Comments
 (0)