We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6cdef51 commit e9790ccCopy full SHA for e9790cc
web-app/next.config.ts
@@ -1,8 +1,12 @@
1
import type { NextConfig } from "next";
2
3
+const isProduction = process.env.NODE_ENV === "production";
4
+
5
const nextConfig: NextConfig = {
- /* config options here */
6
reactStrictMode: true,
7
+ env: {
8
+ NEXT_PUBLIC_API_URL: isProduction ? "http://94.130.176.20:8000" : "http://localhost:8000",
9
+ },
10
};
11
12
export default nextConfig;
web-app/src/pages/api.tsx
@@ -1,4 +1,4 @@
-const API_URL = "http://localhost:8000";
+const API_URL = process.env.NEXT_PUBLIC_API_URL;
export const getMatches = async (token: string) => {
const response = await fetch(`${API_URL}/matches`, {
0 commit comments