# Creating a Simple Server in GoLang

Hey all!\
\
Here are a few snippets of my homelab attempt to build a server with GoLang. Resources used: was the Learn Go Programming Series. I hope to continue utilizing those videos and curate more Golang Projects. These primarily will be used as a Proof-of-Work rather than an in-depth / step-by-step analysis. \
\
Hope you enjoy!

<figure><img src="https://285349023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgsywTcawuKplDJn3TF%2Fuploads%2FfUVhSTs11MuIhlmmmFka%2FScreen%20Shot%202022-12-03%20at%208.30.33%20PM.png?alt=media&#x26;token=5a5e16f0-30d7-4ea6-9db3-9ae33207f5b0" alt=""><figcaption></figcaption></figure>

After going into our installed GoLang src files, we are able to begin creating and building a functional static webserver.\
\
We create 2 files index.html & form.html which will be the landing pages. Form.html constructs the document type, the charsets, and POST methods. The Index will be the landing page of `/ .` \\

<figure><img src="https://285349023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgsywTcawuKplDJn3TF%2Fuploads%2Fb4AWl9rsLig2p3kKIYif%2FScreen%20Shot%202022-12-03%20at%209.38.35%20PM.png?alt=media&#x26;token=0d09a9c2-5439-413b-9759-e59d81535dc3" alt=""><figcaption></figcaption></figure>

Now we begin constructing our `main.go` file. This is the main function of how we begin to run our Go server.

<figure><img src="https://285349023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgsywTcawuKplDJn3TF%2Fuploads%2FnRtVdqbVAsujSJuVTnGK%2FScreen%20Shot%202022-12-03%20at%2010.07.36%20PM.png?alt=media&#x26;token=518fe335-be1d-4475-be01-9d384aa0fc11" alt=""><figcaption></figcaption></figure>

There were were definite moments where all of these packages and http.Handlers were out of my league, but it felt great getting down-and-dirty on the keyboard again.&#x20;

<figure><img src="https://285349023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgsywTcawuKplDJn3TF%2Fuploads%2FWnNaWTbqhCGeIvIglUkK%2FScreen%20Shot%202022-12-03%20at%2010.17.23%20PM.png?alt=media&#x26;token=5abcdd53-6a1e-44c3-bb1c-8abde0df5bc2" alt=""><figcaption></figcaption></figure>
