Sitemap

How I spin up a local Server

3 min readMay 5, 2022

--

Press enter or click to view image in full size
#BuildTogether Day88/100

What does it mean to “spin up a server” and how can you do it?

A server is a computer that provides some service to another computer. A common kind of server is a web server that hosts (stores) the code for a website in its memory and provides a URL where clients (the users of the internet) can access that code. When a web server receives a request, it sends the code over the internet to the client’s browser via Hypertext Transfer Protocol (HTTP).

“Spinning up” a server refers to the discs in the hard-drive of a server physically spinning up to speed to serve their contents.

When developing a new web application, it can be useful to test how the website is served via HTTP before hosting publicly. This is where localhost comes in. localhost can be thought of as a personal web server URL that can be configured to:

  • host content accessible from a particular directory (folder).
  • serve content via HTTP (accessible from computer only).

Thelocalhost can be configured to serve content via HTTP using the code editor VS Code and the extension Live Server.

Spinning Up a Local Server Using Live Server and VS Code

Open VSCode and navigate to the “Extensions” view on the left-hand sidebar. Search for and install the “Live Server” plugin.

Press enter or click to view image in full size

Use VSCode to create a new file called index.html and copy the code and save.

<html> 
<head>
<title> My Website </title>
</head>
<body>
<p> Hello World </p>
</body>
</html>

Click the “Go Live” button at the bottom-right-hand corner of VSCode to start a server on port 5500. This will also prompt your browser to open a new window/tab that loads your index.html file.

Press enter or click to view image in full size

Make changes to the website file and save the file. This will automatically refresh the browser page and you should see the changes you’ve made.

Click again at the port number at the bottom-right corner to close the port.

Press enter or click to view image in full size

Not a very fine day for me, so I will end it here.. If you fancy seeing my 100 days of journey, please drop by

--

--

Henna Singh
Henna Singh

Written by Henna Singh

Technical Speaker and an aspiring writer with avid addiction to gadgets, meet-up groups, and paper crafts. Currently doing Full Stack Diploma at Code Institute

No responses yet