简体   繁体   中英

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. 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. Coming from an angularjs background, what is the equal to using https? Are there any examples that I can look at for guidance?

React doesn't have its own version of the HTTP service.

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.

You can read more about Fetch API here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API

Another alternative is Axios: https://www.npmjs.com/package/axios

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