From 8196c099cdacc2c4e5d5ce5c910defbcf52c9500 Mon Sep 17 00:00:00 2001 From: chenos Date: Thu, 7 Oct 2021 19:02:52 +0800 Subject: [PATCH] fix: api port --- README.zh-CN.md | 5 +++-- .../templates/AppGenerator/docker-compose.yml | 2 +- .../templates/AppGenerator/src/pages/index.tsx | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index 182ddd0f3..5f36093fd 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -66,7 +66,7 @@ Database: 安装 & 运行 ---------- -通过 create-nocobase-app 创建项目 +通过 `create-nocobase-app` 创建项目 ~~~shell mkdir my-nocobase-app && cd my-nocobase-app @@ -74,6 +74,7 @@ yarn create @nocobase/nocobase-app cp .env.example .env docker-compose up -d postgres yarn install +yarn nocobase init yarn start ~~~ @@ -82,8 +83,8 @@ yarn start ~~~shell git clone https://github.com/nocobase/nocobase.git cd nocobase -docker-compose up -d postgres # 用 docker 启动数据库 cp .env.example .env # 配置数据库信息、APP 端口等 +docker-compose up -d postgres # 用 docker 启动数据库 yarn install yarn run bootstrap yarn run build diff --git a/packages/create-nocobase-app/templates/AppGenerator/docker-compose.yml b/packages/create-nocobase-app/templates/AppGenerator/docker-compose.yml index 2817c534a..cae60db90 100644 --- a/packages/create-nocobase-app/templates/AppGenerator/docker-compose.yml +++ b/packages/create-nocobase-app/templates/AppGenerator/docker-compose.yml @@ -28,7 +28,7 @@ services: dockerfile: Dockerfile networks: - nocobase - command: [ "yarn", "start-server", "start", "--port", "8000" ] + command: [ "yarn", "nocobase", "start", "--port", "8000" ] working_dir: /app env_file: ./.env volumes: diff --git a/packages/create-nocobase-app/templates/AppGenerator/src/pages/index.tsx b/packages/create-nocobase-app/templates/AppGenerator/src/pages/index.tsx index 621fd9ca9..0f4a45398 100644 --- a/packages/create-nocobase-app/templates/AppGenerator/src/pages/index.tsx +++ b/packages/create-nocobase-app/templates/AppGenerator/src/pages/index.tsx @@ -13,10 +13,10 @@ import { } from '@nocobase/client'; import { extend } from 'umi-request'; -console.log(`${location.protocol}//${location.hostname}:${process.env.API_PORT}/api/`); +console.log(`${location.protocol}//${location.hostname}:${location.port}/api/`); const request = extend({ - prefix: `${location.protocol}//${location.hostname}:${process.env.API_PORT}/api/`, + prefix: `${location.protocol}//${location.hostname}:${location.port}/api/`, timeout: 30000, });