For security reasons, you cannot open the index.html file in the project directory directly in the browser.
You must set up a local server on your computer. This section explains how to do it.
Building a local server under Windows
Enable Internet Information Service
- In Control Panel, click Programs.
- Click on “Turn Windows features on or off”.
- In the “Windows Features” window, click “Internet Information Services” to enable it.*Not selected, but not completely selected
- Click OK.
Where the files are installed
When Internet Information Services is enabled, a local server folder will be automatically created. Place the project folder in this folder.
- Click “This PC” → “Local Disk (C:)”.
- Open the “wwwroot” folder in the “inetpub” folder.
- Put your project folder in the “wwwroot” folder.
Visit in your browser
- Open your browser.
- Enter the following address in the address bar and confirm.
http://<IP address>/project folder name/
or
http://<computer name>/project folder name/
or
http://localhost/project folder name/
Example) http://192.168.0.1/project folder name/
Finding the Computer Name
- Open a File Explorer window, right-click “This PC” in the sidebar and click “Properties”.
- Find the name of your computer to the right of “Computer name:” under the “Computer Name, Domain, and Workgroup Settings” area of the “System” window.
Find your IP address
- In Control Panel, click View network status and tasks.
- In the Network and Sharing Center window, click Connections: Local Area Connection.
- In the Local Area Connection Status window that appears, click Details…
- The number you find to the right of “IPv4 Address” is your IP address.
Setting up localhost
To access http://localhost/ in your browser, you need to set up the “hosts” file.
- Click the “Start” button, go to “All Programs” → “Accessories”. Right-click “Notepad” and click “Run as administrator”.
- In Notepad, click “File” → “Open” and navigate to “C:\Windows\System32\drivers\etc”. Select “All Files (*.*)” and open the “hosts” file.
- Modify the following location in the file and save the file.
■ Before modification# 127.0.0.1 localhost ■After modification127.0.0.1 localhost - Restart Windows.
Mac OSX local server setup
In Mac computers, Apache is installed by default. You can use a local server by running Apache.
Basic Apache Operations
Enter the command in the terminal to run Apache.
Run Apache
$ sudo apachectl start
Exit Apache
$ sudo apachectl stop
Where the files are installed
Place the project folder in the following location.
/Library/WebServer/Documents
* When creating a new project and saving it, the project folder will be located in the location specified by “Location”.
Visit in your browser
- Open your browser.
- Enter the following address in the address bar and confirm.
http://localhost/project folder name/