Start a Simple Server

With one line of python command

Sometimes we debug html locally but run into the error

XMLHttpRequest cannot load file:///xxx/xxx/xxxx.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

The solution is to run a very simple static web server locally by using a python one-liner

python -m SimpleHTTPServer 8000

Planted: by ;

L Ma (2016). 'Start a Simple Server', Datumorphism, 09 April. Available at: https://datumorphism.leima.is/til/programming/start-simple-server/.