Novice nodejs asks how static pages load data from nodejs.

  node.js, question

The problem is this:

There is a static page first, and the url of ajax is set to the address that nodejs listens to, so that when ajax sends out a request, nodejs can respond and return to the static page. however, to use ajax, static pages must be placed on the local server, and nodejs and static pages will have cross-domain problems. what other solutions can be found but “access-control-allow-origin”: “http://127.0.0.1: port”?

Does nodejs build a local server, so there are only two local servers?

App.use (“routing address”, express.static (“directory”);
Just hang your static state below.