Create a Simple HTTP Server with NodeJS
Instead of accessing through file:///
The question is why do you need a HTTP only to access static data sources?
Failed to load file:///E:/webexamples/reactjs/hello-reactjs/person.jsx: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
First of all, make sure that you have installed the NodeJS on your computer. Otherwise, please install it as in the following instructions :
Create an empty directory:
Open the CMD window, and CD to the folder you created in the previous step.
Run the following command to install http-server:
npm install -g http-server
# Note: -c-1 to disable caching!! http-server -c-1
Your HTTP Server has been started. it is listening at port 8080. You can check it by visiting the following link:
Create a HTML file in that directory, and you can access it via HTTP: