Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Environment variables
.env
.env.*.local
5 changes: 4 additions & 1 deletion src/constants/apiPaths.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const apiUrl = import.meta.env.VITE_PRODUCTS_API_URL;

const API_PATHS = {
product: "https://.execute-api.eu-west-1.amazonaws.com/dev",
order: "https://.execute-api.eu-west-1.amazonaws.com/dev",
import: "https://.execute-api.eu-west-1.amazonaws.com/dev",
bff: "https://.execute-api.eu-west-1.amazonaws.com/dev",
// bff: "https://.execute-api.eu-west-1.amazonaws.com/dev",
bff: apiUrl,
cart: "https://.execute-api.eu-west-1.amazonaws.com/dev",
};

Expand Down
8 changes: 4 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const queryClient = new QueryClient({
},
});

if (import.meta.env.DEV) {
const { worker } = await import("./mocks/browser");
worker.start({ onUnhandledRequest: "bypass" });
}
// if (import.meta.env.DEV) {
// const { worker } = await import("./mocks/browser");
// worker.start({ onUnhandledRequest: "bypass" });
// }

const container = document.getElementById("app");
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Expand Down
2 changes: 1 addition & 1 deletion src/queries/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function useAvailableProducts() {
"available-products",
async () => {
const res = await axios.get<AvailableProduct[]>(
`${API_PATHS.bff}/product/available`
`${API_PATHS.bff}/products`
);
return res.data;
}
Expand Down
9 changes: 9 additions & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
/// <reference types="vitest" />
/// <reference types="vite/client" />

// interface ImportMetaEnv {
// readonly VITE_API_URL: string;
// // add other env vars here
// }

// interface ImportMeta {
// readonly env: ImportMetaEnv;
// }