简体   繁体   中英

Is it possible to serve React from Node?

I'm new to back-end coding, and I'm struggling to understand exactly what a "fullstack" app would look like. Is it:

  • A Node-Express server that serves index.html , which has <script src="main.jsx"></script> in it (If this is the case, how would the .jsx content get compiled into browser-ready javascript?)
  • A Node-Express server that serves some data ( .json ) + a frontend app (that you would initialize with Vite or CRA) that fetches from said server?

Both are currect, your server can serve content to the cliend (first case) or send data to the client ( json , xml or etc).

Note that when you are working with react and .jsx component you have to build your project and server the html file (including js , css ) via express server

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