拉取dify的源码后,本地通过readme文件启动了api/web模块。然后打开网址localhost:3000的时候页面一直加载,控制台报错具体如下: #108

Closed
opened 2026-02-21 17:26:00 -05:00 by yindo · 4 comments
Owner

Originally created by @codingpaidaxing on GitHub (May 28, 2023).

Originally created by @codingpaidaxing on GitHub (May 28, 2023).
yindo closed this issue 2026-02-21 17:26:00 -05:00
Author
Owner

@codingpaidaxing commented on GitHub (May 28, 2023):

image 主要修改的配置: image 同时在api下增加了.env文件也就是.env.example文件
@codingpaidaxing commented on GitHub (May 28, 2023): <img width="1463" alt="image" src="https://github.com/langgenius/dify/assets/122680363/e237cd45-88b6-49df-9fd7-0bc258e9d296"> 主要修改的配置: <img width="1476" alt="image" src="https://github.com/langgenius/dify/assets/122680363/595846aa-8d8f-4a2d-921b-310568b80f86"> 同时在api下增加了.env文件也就是.env.example文件
Author
Owner

@yuhao1118 commented on GitHub (May 28, 2023):

不需要改config文件。把web文件夹下的.env.example复制一份到.env,然后正常启动api和web项目即可

@yuhao1118 commented on GitHub (May 28, 2023): 不需要改config文件。把web文件夹下的.env.example复制一份到.env,然后正常启动api和web项目即可
Author
Owner

@codingpaidaxing commented on GitHub (May 28, 2023):

但是这样我看访问的不是自己本地的api。而是cloud.dify api。我是想本地启动

@codingpaidaxing commented on GitHub (May 28, 2023): 但是这样我看访问的不是自己本地的api。而是cloud.dify api。我是想本地启动
Author
Owner

@takatost commented on GitHub (May 28, 2023):

# CORS configuration
WEB_API_CORS_ALLOW_ORIGINS=*
CONSOLE_CORS_ALLOW_ORIGINS=*

# Cookie configuration
COOKIE_HTTPONLY=true
COOKIE_SAMESITE=Lax
COOKIE_SECURE=false

You can configure the cross-domain policy mentioned above.

@takatost commented on GitHub (May 28, 2023): ``` # CORS configuration WEB_API_CORS_ALLOW_ORIGINS=* CONSOLE_CORS_ALLOW_ORIGINS=* # Cookie configuration COOKIE_HTTPONLY=true COOKIE_SAMESITE=Lax COOKIE_SECURE=false ``` You can configure the cross-domain policy mentioned above.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#108