Go service as a web server

Serve HTML, CSS and Javascript files

Petr Jahoda
The Startup

--

Original Gopher image created by Renee French, used Gopher image created by Maria Letta
  1. part: creating the service
  2. part: improving the service
  3. part: you are reading it right now
  4. part: adding SSE
  5. part: simple javascript frontend functionality
  6. part: frontend — backend communication
  7. part: server-side logging
  8. part: run it all in docker
  9. part: adding database container
  10. part: database — service communication

Addition 1: functions, methods, pointers and interfaces
Addition 2: websocket communication
Addition 3: socket communication

Why should you use Go as a web server?

That is a valid question. We have Apache, Nginx, IIS and bunch of other web servers. You can write web server in Java, Node, PHP or whatever else.

So why use Go?

Because creating Go web server is simple. Because Go web server is fast. Because you can run your web server a a single executable. Because you can run it on all three major systems the same way. Because you can run it easily in Docker. And because you can use one technology— Go…

--

--