Skip to content

Commit e9790cc

Browse files
committed
front: add dev and prod url
1 parent 6cdef51 commit e9790cc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

web-app/next.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import type { NextConfig } from "next";
22

3+
const isProduction = process.env.NODE_ENV === "production";
4+
35
const nextConfig: NextConfig = {
4-
/* config options here */
56
reactStrictMode: true,
7+
env: {
8+
NEXT_PUBLIC_API_URL: isProduction ? "http://94.130.176.20:8000" : "http://localhost:8000",
9+
},
610
};
711

812
export default nextConfig;

web-app/src/pages/api.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const API_URL = "http://localhost:8000";
1+
const API_URL = process.env.NEXT_PUBLIC_API_URL;
22

33
export const getMatches = async (token: string) => {
44
const response = await fetch(`${API_URL}/matches`, {

0 commit comments

Comments
 (0)