Chen-Gary / Chen-Gary/note-squared

Run Server in Local Computer

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
documentation
Dominant language
Vue
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## 1. Environment

* Node.js

Server will run in port **3000** (i.e. `localhost:3000`)

* MongoDB

完全使用默认配置

* 保证 MongoDB daemon 运行在 port **27017**
* 不设置数据库用户名、密码
* 运行 server 后,会自动创建名为 `note_squared` 的数据库,可使用MongoDB Compass查看

## 2. Run Server

```shell
cd /note-squared/server

# 安装依赖
npm install

# 使用 nodemon 运行 server(如果修改 server 代码,会自动 restart)
npm run dev

# OR 使用以下命令(如果修改 server 代码,不会自动 restart)
npm run start
```

## 3. 其他注意事项

* **如何获得一个带有 admin 权限的账号?**

现在无法直接注册带有 admin 权限的账号了,需要手动修改数据库: users => role,手动改为`admin` / `normal`

![image](https://user-images.githubusercontent.com/75373727/161735089-6f7eeb50-d652-4dd7-a4b9-f8e5170d0529.png)

* **注册时,需要验证邮箱吗?**

目前调用获取邮箱验证码的API后,验证码会直接返回给前端,所以即使填了假邮箱也没事。

如果需要测试邮件是否真的能发送,找到`server/app/router/user/register_emailVerificationCode.js`文件中以下代码:

```javascript
// send verification email
// (temporarily removed)
//await nodemailer.sendVerificationCode(_email, _email, _verificationCode)
```

删掉最后一行的注释即可。

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.