A local server is a program used to serve local content to be accessible over HTTP (Hypertext Transfer Protocol), just like a web server does for an online website.

Image for post
Image for post
Photo by Priscilla Du Preez on Unsplash

When you try to open a website project locally or start developing a new web project and open the index.html file in your browser, the URL on the address bar is something like file://address-of-the-file.html. note that it says the project is served using file protocol instead of http as a normal web page.

In this case, the web page’s contents and functionalities like images or styles and scripts don't load and run as expected. It happens because there is no program (a web server) to accept requests from the page and respond to them. in these cases, if you open the browser console, because the page can’t access files using absolute paths (as javascript only can access relatively addressed files over file protocol) you may see errors like…

Mohammad H. Sattarian

Front-end Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store