简体   繁体   English

如何将后端(Node.js)链接到前端(React)

[英]How to LInk Backend(Node.js) to front-End(React)

I am starting out on React.js after learning Node.js using Express.在使用 Express 学习 Node.js 后,我开始使用 React.js。 But I don't know How to Link my Backend App to front end React files?但我不知道如何将我的后端应用程序链接到前端 React 文件? Can someone provide me a simple solution to the problem有人可以为我提供一个简单的问题解决方案吗

You can begin with this steps, you got a thousands of topics about to make a complete and solid infrastructure:您可以从以下步骤开始,您将获得数以千计的主题来构建完整而可靠的基础架构:

  1. Initialise your node.js server with port, cors (if you need)使用端口、cors 初始化您的 node.js 服务器(如果需要)
  2. Learn how express work with node.js and create your first route了解 express 如何使用 node.js 并创建您的第一个路由
  3. Initialize your react project with or without npx create-react-app使用或不使用 npx create-react-app 初始化您的反应项目
  4. Create your first frontend component and fetch data from your API创建您的第一个前端组件并从您的 API 中获取数据

Link : https://www.freecodecamp.org/news/create-a-react-frontend-a-node-express-backend-and-connect-them-together-c5798926047c/链接: https : //www.freecodecamp.org/news/create-a-react-frontend-a-node-express-backend-and-connect-them-together-c5798926047c/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从Node.js后端获取req.query值到React-Redux前端? - How to get req.query value from Node.js backend to React-Redux front-end? 如何正确地在前端和 node.js 后端之间发送 firebase auth tokenId - How is correctly way to send firebase auth tokenId between front-end and node.js backend 如何使用node.js来运行react.js前端? - how do use node.js to run react.js front-end? 如何使用 node.js 更改前端 html - How to change front-end html using node.js 如何使用 node.js(express) API 调用访问搜索参数并在 React 前端提供服务 - How to access search params with node.js(express) API call and served on react front-end 如何将后端创建用户 function 连接到前端(Node.js、React.js、MongoDB) - How to connect backend create user function to front end (Node.js, React.js, MongoDB) 通过从Node.js和Express.js中的前端请求数据来创建动态链接 - Creating dynamic link by requesting data from front-end in Node.js and Express.js 无法从 React 前端向 Node.js 后端发送 POST 请求 - Can't send POST request from React front-end to Node.js back-end 尝试连接前端(React)和后端(Node.js)时导入 Express - Importing Express while trying to connect front-end(React) and back-end(Node.js) NGinx 不在 Node.js 后端和 React 前端之间路由 - NGinx not routing between Node.js back-end and React front-end
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM