简体   繁体   中英

how to start a project with react as front end and flask as backend?

I want to start a project with react as front end and flask as backend and mongodb as my database. How can I connect the react code to the flask code

您必须通过flask 创建rest 服务,然后使用react 请求通过这些服务获取/插入数据。

You will wanna take a look at create-react-app that will get you started on the front end. You the wanna build the api using flask and hit those endpoints with the front end to consume the api.

To make the request i recommend using the following fetch or axios.

While building the api i recommend using postman to see the kind of data you're sending back.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM