updated on Jan. 17, 2022
This is a template with React + Flask + MongoDB for instant build of a VA system
Client:
- 安装client依赖:
cd client | npm install - 启动client:
npm start
Server:
- 创建虚拟环境 + 激活:
mkvirtualenv ENV_NAME+workon ENV_NAME - 根据
requirements安装依赖包:pip install -r requirements.txt - 启动项目:
cd server | python app.py
IF:
如果
React控制台可以console.log出hello, 说明前后台可以正常通信
或者
React可以通过axios从http://localhost:3000/api/add_one取到后端Flask接口http://localhost:5000/add_one提供的数据,那么说明前后台可以正常通信
MongoDB:
- 创建db: 通过
Robo 3T直接创建 - 测试链接: 通过访问
http://localhost:5000/add_one查看是否有数据插入