Today I was asked to create a simple static html page that reads a json file with some information to show it on a grid. I've created the structure, added some bootstrap css files and opened the index.html on a browser and an error...
Reason: CORS request not HTTP
The solution was to run a web server to access the static html page. I needed it quick and easy. Found out I could install it via npm and run it on the base directory.
So, to install the server:
$npm install -g http-server
And to run it:
Starting up http-server, serving ./
Top comments (1)
Another quick one is
python -m SimpleHTTPServerwhich will work on most systems (most systems come with Python installed) and doesn't require any additional modules to install.