What are the basic steps in order to create a HTML server in Golang?

Good morning everyone,

I’m a self-taught web developer and have created a web site in HTML5/CSS3/JavaScript.

Now that the frontend part is OK, I would like to start learning backend development.

I found Golang which (in my opinion) is very good due to its C like approach (I already know C) and performance.

I then read https://golang.org/doc/articles/wiki/#tmp_0 and articles about Golang’s syntax.

The question is, what are the basic steps in order to create a HTML server in Golang ?

The goal is just to create a server locally in order to access my “index.html” file which itself will call the CSS and JS files.

Thank you in advance for your help guys ! :slight_smile:

Personally I found this article helpful showing how to create a handleFunc for a url path and using ListenAndServe to start the server. Give it a through read!

1 Like

Hello, after reading what Boris Wolff suggests you can check gorilla web kit. But I’d do more research and study on the language first.

Also: Gin which can render HTML.

Good morning everyone,

Thank you for all of your answers.

I read this article and it helped me a lot :

https://www.alexedwards.net/blog/serving-static-sites-with-go

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.