-
Notifications
You must be signed in to change notification settings - Fork 177
Setting up a local server
yzjing edited this page Oct 25, 2016
·
1 revision
It is useful, and often necessary, to test your HTML file via a local server. This is because browsers often block some Javascript features for security reasons: for example, if you just double-click-open the HTML file, it may not allow the page to access other data files on your computer, which means your data-binding methods won't work. Besides, using a local server ensures a consistent environment when you publish your website online.
-
Open the terminal and cd to the directory where your HTML files are in.
-
If you're using Python3:
python -m http.server
Python2:
python -m SimpleHTTPServer
-
On your browser, go to
http://localhost:8000/