From a430284aa21e3ae1f0d5654e55b2ad2852519cc2 Mon Sep 17 00:00:00 2001 From: wwf <yearningwang@iqtogether.com> Date: 星期三, 04 六月 2025 15:17:49 +0800 Subject: [PATCH] 初始化 --- README.md | 26 ++++++++++++-------------- 1 files changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ddb1155..ce5239e 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,14 @@ ### Run by source code -Before starting the web frontend service, please make sure the following environment is ready. -- [Node.js](https://nodejs.org) >= v22.11.x -- [pnpm](https://pnpm.io) v10.x +To start the web frontend service, you will need [Node.js v18.x (LTS)](https://nodejs.org/en) and [NPM version 8.x.x](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com/). First, install the dependencies: ```bash -pnpm 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: @@ -31,12 +31,10 @@ # different from api or web app domain. # example: http://cloud.dify.ai/console/api NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api -NEXT_PUBLIC_WEB_PREFIX=http://localhost:3000 # 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/api NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api -NEXT_PUBLIC_PUBLIC_WEB_PREFIX=http://localhost:3000 # SENTRY NEXT_PUBLIC_SENTRY_DSN= @@ -45,7 +43,9 @@ Finally, run the development server: ```bash -pnpm run dev +npm run dev +# or +yarn dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. @@ -59,22 +59,20 @@ First, build the app for production: ```bash -pnpm run build +npm run build ``` Then, start the server: ```bash -pnpm run start +npm run start ``` If you want to customize the host and port: ```bash -pnpm run start --port=3001 --host=0.0.0.0 +npm run start --port=3001 --host=0.0.0.0 ``` - -If you want to customize the number of instances launched by PM2, you can configure `PM2_INSTANCES` in `docker-compose.yaml` or `Dockerfile`. ## Storybook @@ -83,7 +81,7 @@ To start the storybook server, run: ```bash -pnpm storybook +yarn storybook ``` Open [http://localhost:6006](http://localhost:6006) with your browser to see the result. @@ -101,7 +99,7 @@ Run test: ```bash -pnpm run test +npm run test ``` If you are not familiar with writing tests, here is some code to refer to: -- Gitblit v1.8.0