feat: generate default env file
This commit is contained in:
parent
50e4ac33ef
commit
e108617182
@ -1,3 +1,4 @@
|
||||
@@ -1,71 +1,73 @@
|
||||
# Dify Frontend
|
||||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
||||
|
||||
@ -8,7 +9,9 @@ To start the web frontend service, you will need [Node.js v18.x (LTS)](https://n
|
||||
First, install the dependencies:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
npm install
|
||||
# or
|
||||
yarn install --frozen-lockfile
|
||||
```
|
||||
|
||||
Then, configure the environment variables. Create a file named `.env.local` in the current directory and copy the contents from `.env.example`. Modify the values of these environment variables according to your requirements:
|
||||
@ -29,15 +32,15 @@ NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api
|
||||
# SENTRY
|
||||
NEXT_PUBLIC_SENTRY_DSN=
|
||||
|
||||
# optional
|
||||
NEXT_PUBLIC_SITE_ABOUT=
|
||||
NEXT_PUBLIC_MAINTENANCE_NOTICE=
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
Finally, run the development server:
|
||||
|
||||
```bash
|
||||
run dev
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
```
|
||||
@ -50,17 +53,17 @@ You can start editing the file under folder `app`. The page auto-updates as you
|
||||
### Deploy on server
|
||||
First, build the app for production:
|
||||
```bash
|
||||
yarn run build
|
||||
npm run build
|
||||
```
|
||||
|
||||
Then, start the server:
|
||||
```bash
|
||||
yarn run start
|
||||
npm run start
|
||||
```
|
||||
|
||||
If you want to customize the host and port:
|
||||
```bash
|
||||
yarn run start --port=3001 --host=0.0.0.0
|
||||
npm run start --port=3001 --host=0.0.0.0
|
||||
```
|
||||
|
||||
## Lint Code
|
||||
|
@ -9,7 +9,7 @@
|
||||
"lint": "next lint",
|
||||
"fix": "next lint --fix",
|
||||
"eslint-fix": "eslint --fix",
|
||||
"prepare": "npx only-allow yarn && cd ../ && node -e \"if (process.env.NODE_ENV !== 'production'){process.exit(1)} \" || husky install ./web/.husky",
|
||||
"prepare": "cp .env.example .env && cd ../ && node -e \"if (process.env.NODE_ENV !== 'production'){process.exit(1)} \" || husky install ./web/.husky",
|
||||
"gen-icons": "node ./app/components/base/icons/script.js",
|
||||
"uglify-embed": "node ./bin/uglify-embed",
|
||||
"check-i18n": "node ./i18n/script.js"
|
||||
@ -132,6 +132,5 @@
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.17.0"
|
||||
},
|
||||
"packageManager": "yarn@4.2.1"
|
||||
}
|
||||
}
|
17462
web/yarn.lock
17462
web/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user