Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Jun 10, 2023
1 parent a377683 commit 4180311
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,46 @@ i 是你当前的能力 在这个难度基础上再 +1 就是适合你的项目
而测试就是这个问题的解


## 安装
## 启动项目

执行下面的命令即可
### 1. 安装项目依赖

```bash
pnpm bootstrap
# 或者使用 pnpm i
pnpm bootstrap
```
### 2. 启动后端服务

```bash
pnpm docker:be
```

通过 docker 来启动后端服务以及 mongoDB 服务

启动成功后就可以通过 http://localhost:3000/ 访问到后端服务了

如果你使用了 mongoDB client 之类的应用 可以直接连接 http://localhost:27017

注意:
1. 这里将会占用 3000 以及 27017 端口,请检查在启动之前是否端口被占用的问题
2. 通过 docker:be 进入的是 prod 环境 不过对于我们写测试来讲也不需要关心后端逻辑

#### 如何开发修改后端代码并进入开发模式

需要按照以下步骤执行 (不过理论上来讲你也不太需要开发修改后端代码)

```bash
pnpm dev:be
```

这时候会启动后端服务, 但是后端服务依赖 mongoDB server, 地址也是写死的: http://localhost:27017

所以你需要保证你本地有开启 mongoDB server

这里有两个选项:
1. 自己在本地开启 mongoDB server
2. 使用 pnpm docker:be 启动 后端 server 以及 mongoDB server , 然后你手动把后端 server 给关了 只留一个 mongoDB server 就可以

执行这个命令安装依赖的话 会跳过 cypress 的安装
> 因为有很多同学反馈在安装 cypress 的时候超时

## 代码贡献指南

Expand Down

0 comments on commit 4180311

Please sign in to comment.