Add APP URL env variable to frontend project
This commit is contained in:
@@ -22,4 +22,5 @@ FIRST_SUPERUSER_PASSWORD=Admin123
|
|||||||
# Frontend settings
|
# Frontend settings
|
||||||
FRONTEND_PORT=3000
|
FRONTEND_PORT=3000
|
||||||
NEXT_PUBLIC_API_URL=http://localhost:8000
|
NEXT_PUBLIC_API_URL=http://localhost:8000
|
||||||
|
NEXT_PUBLIC_APP_URL=http://localhost:3000
|
||||||
NODE_ENV=development
|
NODE_ENV=development
|
||||||
@@ -53,6 +53,7 @@ services:
|
|||||||
target: deps
|
target: deps
|
||||||
args:
|
args:
|
||||||
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||||
|
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
|
||||||
volumes:
|
volumes:
|
||||||
- ./frontend:/app
|
- ./frontend:/app
|
||||||
- /app/node_modules
|
- /app/node_modules
|
||||||
@@ -62,6 +63,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
- NODE_ENV=development
|
||||||
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||||
|
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
command: npm run dev
|
command: npm run dev
|
||||||
|
|||||||
@@ -47,9 +47,11 @@ services:
|
|||||||
target: runner
|
target: runner
|
||||||
args:
|
args:
|
||||||
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||||
|
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||||
|
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
export const RESERVED_SLUGS = ["new", "edit", "delete", "settings"];
|
export const RESERVED_SLUGS = ["new", "edit", "delete", "settings"];
|
||||||
export const BACKEND_API_URL = process.env.NEXT_PUBLIC_API_URL;
|
export const BACKEND_API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||||
|
export const APP_URL =
|
||||||
|
process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000";
|
||||||
|
|||||||
Reference in New Issue
Block a user