Frontend to Backend Communication Between Go and JavaScript

Very simple and clean example

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: upgrade for web
  4. part: adding SSE
  5. part: simple javascript frontend functionality
  6. part: you are reading it right now
  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

Is it hard to program a communication between frontend and backend?

I can only answer in case of Go and vanilla Javascript. And in this case the answer is: it is as easy as riding a bike.

If you want to be convinced, keep reading. In few minutes you will see and understand that you can do it by yourself. You will send data from webpage to server and back, without even refreshing the page itself.

Prepare before coding

--

--