Skip to content

Commit ee1007f

Browse files
author
chen zhang
committed
rename SERVER_BASE_URL to NEXT_PUBLIC_SERVER_BASE_URL as previous one be blocked by nodejs(without NEXT_PUBLIC* prefix)
1 parent 2777fae commit ee1007f

File tree

13 files changed

+17
-17
lines changed

13 files changed

+17
-17
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ exit $?' > /app/start.sh && chmod +x /app/start.sh
9898
# Set environment variables
9999
ENV PORT=8001
100100
ENV NODE_ENV=production
101-
ENV SERVER_BASE_URL=http://localhost:${PORT:-8001}
101+
ENV NEXT_PUBLIC_SERVER_BASE_URL=http://localhost:${PORT:-8001}
102102

103103
# Create empty .env file (will be overridden if one exists at runtime)
104104
RUN touch .env

Dockerfile-ollama-local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ exit $?' > /app/start.sh && chmod +x /app/start.sh
107107
# Set environment variables
108108
ENV PORT=8001
109109
ENV NODE_ENV=production
110-
ENV SERVER_BASE_URL=http://localhost:${PORT:-8001}
110+
ENV NEXT_PUBLIC_SERVER_BASE_URL=http://localhost:${PORT:-8001}
111111

112112
# Create empty .env file (will be overridden if one exists at runtime)
113113
RUN touch .env

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ docker-compose up
318318
| `AZURE_OPENAI_ENDPOINT` | Azure OpenAI endpoint | No | Required only if you want to use Azure OpenAI models |
319319
| `AZURE_OPENAI_VERSION` | Azure OpenAI version | No | Required only if you want to use Azure OpenAI models |
320320
| `OLLAMA_HOST` | Ollama Host (default: http://localhost:11434) | No | Required only if you want to use external Ollama server |
321-
| `PORT` | Port for the API server (default: 8001) | No | If you host API and frontend on the same machine, make sure change port of `SERVER_BASE_URL` accordingly |
322-
| `SERVER_BASE_URL` | Base URL for the API server (default: http://localhost:8001) | No |
321+
| `PORT` | Port for the API server (default: 8001) | No | If you host API and frontend on the same machine, make sure change port of `NEXT_PUBLIC_SERVER_BASE_URL` accordingly |
322+
| `NEXT_PUBLIC_SERVER_BASE_URL` | Base URL for the API server (default: http://localhost:8001) | No |
323323
| `DEEPWIKI_AUTH_MODE` | Set to `true` or `1` to enable authorization mode. | No | Defaults to `false`. If enabled, `DEEPWIKI_AUTH_CODE` is required. |
324324
| `DEEPWIKI_AUTH_CODE` | The secret code required for wiki generation when `DEEPWIKI_AUTH_MODE` is enabled. | No | Only used if `DEEPWIKI_AUTH_MODE` is `true` or `1`. |
325325

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
environment:
1414
- PORT=${PORT:-8001}
1515
- NODE_ENV=production
16-
- SERVER_BASE_URL=http://localhost:${PORT:-8001}
16+
- NEXT_PUBLIC_SERVER_BASE_URL=http://localhost:${PORT:-8001}
1717
- LOG_LEVEL=${LOG_LEVEL:-INFO}
1818
- LOG_FILE_PATH=${LOG_FILE_PATH:-api/logs/application.log}
1919
volumes:

next.config.ts

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

3-
const TARGET_SERVER_BASE_URL = process.env.SERVER_BASE_URL || 'http://localhost:8001';
3+
const TARGET_SERVER_BASE_URL = process.env.NEXT_PUBLIC_SERVER_BASE_URL || 'http://localhost:8001';
44

55
const nextConfig: NextConfig = {
66
/* config options here */

src/app/[owner]/[repo]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ Remember:
518518

519519
try {
520520
// Create WebSocket URL from the server base URL
521-
const serverBaseUrl = process.env.SERVER_BASE_URL || 'http://localhost:8001';
521+
const serverBaseUrl = process.env.NEXT_PUBLIC_SERVER_BASE_URL || 'http://localhost:8001';
522522
const wsBaseUrl = serverBaseUrl.replace(/^http/, 'ws')? serverBaseUrl.replace(/^https/, 'wss'): serverBaseUrl.replace(/^http/, 'ws');
523523
const wsUrl = `${wsBaseUrl}/ws/chat`;
524524

@@ -815,7 +815,7 @@ IMPORTANT:
815815

816816
try {
817817
// Create WebSocket URL from the server base URL
818-
const serverBaseUrl = process.env.SERVER_BASE_URL || 'http://localhost:8001';
818+
const serverBaseUrl = process.env.NEXT_PUBLIC_SERVER_BASE_URL || 'http://localhost:8001';
819819
const wsBaseUrl = serverBaseUrl.replace(/^http/, 'ws')? serverBaseUrl.replace(/^https/, 'wss'): serverBaseUrl.replace(/^http/, 'ws');
820820
const wsUrl = `${wsBaseUrl}/ws/chat`;
821821

src/app/[owner]/[repo]/slides/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ Give me the numbered list with brief descriptions for each slide. Be creative bu
265265

266266
try {
267267
// Create WebSocket URL from the server base URL
268-
const serverBaseUrl = process.env.SERVER_BASE_URL || 'http://localhost:8001';
268+
const serverBaseUrl = process.env.NEXT_PUBLIC_SERVER_BASE_URL || 'http://localhost:8001';
269269
const wsBaseUrl = serverBaseUrl.replace(/^http/, 'ws')? serverBaseUrl.replace(/^https/, 'wss'): serverBaseUrl.replace(/^http/, 'ws');
270270
const wsUrl = `${wsBaseUrl}/ws/chat`;
271271

@@ -541,7 +541,7 @@ Please return ONLY the HTML with no markdown formatting or code blocks. Just the
541541

542542
try {
543543
// Create WebSocket URL from the server base URL
544-
const serverBaseUrl = process.env.SERVER_BASE_URL || 'http://localhost:8001';
544+
const serverBaseUrl = process.env.NEXT_PUBLIC_SERVER_BASE_URL || 'http://localhost:8001';
545545
const wsBaseUrl = serverBaseUrl.replace(/^http/, 'ws')? serverBaseUrl.replace(/^https/, 'wss'): serverBaseUrl.replace(/^http/, 'ws');
546546
const wsUrl = `${wsBaseUrl}/ws/chat`;
547547

src/app/[owner]/[repo]/workshop/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ Make the workshop content in ${language === 'en' ? 'English' :
317317

318318
try {
319319
// Create WebSocket URL from the server base URL
320-
const serverBaseUrl = process.env.SERVER_BASE_URL || 'http://localhost:8001';
320+
const serverBaseUrl = process.env.NEXT_PUBLIC_SERVER_BASE_URL || 'http://localhost:8001';
321321
const wsBaseUrl = serverBaseUrl.replace(/^http/, 'ws')? serverBaseUrl.replace(/^https/, 'wss'): serverBaseUrl.replace(/^http/, 'ws');
322322
const wsUrl = `${wsBaseUrl}/ws/chat`;
323323

src/app/api/auth/status/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NextResponse } from "next/server";
22

3-
const TARGET_SERVER_BASE_URL = process.env.SERVER_BASE_URL || 'http://localhost:8001';
3+
const TARGET_SERVER_BASE_URL = process.env.NEXT_PUBLIC_SERVER_BASE_URL || 'http://localhost:8001';
44

55
export async function GET() {
66
try {

src/app/api/auth/validate/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NextRequest, NextResponse } from "next/server";
22

3-
const TARGET_SERVER_BASE_URL = process.env.SERVER_BASE_URL || 'http://localhost:8001';
3+
const TARGET_SERVER_BASE_URL = process.env.NEXT_PUBLIC_SERVER_BASE_URL || 'http://localhost:8001';
44

55
export async function POST(request: NextRequest) {
66
try {

0 commit comments

Comments
 (0)