简体   繁体   English

你如何在MySQL上使用node和react.js前端?

[英]how do you use node with mysql for react.js front end?

so I have a project that I want to use react.js for my front end and use node with mysql for my back end. 所以我有一个项目,我想在前端使用react.js,在后端使用mysql节点。 Is there any guides or examples that would help me with this? 是否有任何指南或示例可以帮助我解决这个问题? I know how to use node with mysql but having trouble connecting it to react.js front end. 我知道如何将节点与mysql一起使用,但无法将其连接到react.js前端。 Coming from an angularjs background, what is the equal to using https? 来自angularjs背景,等于使用https? Are there any examples that I can look at for guidance? 有什么例子可以指导我吗?

React doesn't have its own version of the HTTP service. React没有自己的HTTP服务版本。

You can use something like Fetch: https://www.npmjs.com/package/whatwg-fetch which is a polyfill for the not yet fully supported Fetch API. 您可以使用类似Fetch的方法: https ://www.npmjs.com/package/whatwg-fetch,它是尚未完全支持的Fetch API的polyfill。

You can read more about Fetch API here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API 您可以在此处阅读有关Fetch API的更多信息: https : //developer.mozilla.org/en-US/docs/Web/API/Fetch_API

Another alternative is Axios: https://www.npmjs.com/package/axios 另一种替代方法是Axios: https//www.npmjs.com/package/axios

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

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