fix: bootstrap env

This commit is contained in:
yuhao1118 2023-05-21 17:07:36 +08:00
parent 18d1f6a6c6
commit fc34d2f2f7
4 changed files with 19 additions and 2 deletions

View File

@ -14,7 +14,7 @@ CONSOLE_URL=http://127.0.0.1:5001
API_URL=http://127.0.0.1:5001
# Web APP base URL
APP_URL=http://127.0.0.1:5001
APP_URL=http://127.0.0.1:3000
# celery configuration
CELERY_BROKER_URL=redis://:difyai123456@localhost:6379/1

9
web/.env.example Normal file
View File

@ -0,0 +1,9 @@
EDITION=SELF_HOSTED
# The base URL of console application, refers to the Console base URL of WEB service if console domain is
# different from api or web app domain.
# example: http://cloud.dify.ai
CONSOLE_URL=http://localhost:5001
# The URL for Web APP, refers to the Web App base URL of WEB service if web app domain is different from
# console or api domain.
# example: http://udify.app
APP_URL=http://localhost:5001

8
web/env.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
[ ! -f .env ] || export $(grep -v '^#' .env | xargs)
export NEXT_PUBLIC_DEPLOY_ENV=${DEPLOY_ENV}
export NEXT_PUBLIC_EDITION=${EDITION}
export NEXT_PUBLIC_API_PREFIX=${CONSOLE_URL}/console/api
export NEXT_PUBLIC_PUBLIC_API_PREFIX=${APP_URL}/api

View File

@ -3,7 +3,7 @@
"version": "0.2.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "source env.sh && next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",