Trying docker ps from Go to the Frontend
A small build log for today…
My goal was to try a very simple OS interaction in Go, then show the result in the frontend.
On the backend, I added dockerPsHandler() that runs docker ps using Go’s exec.Command(...), then returns the output through an API endpoint.
On the frontend, I added a button that calls fetch('/api/docker/ps') and displays the result on the page. I also added a Vite proxy so the frontend can access the Go backend through /api during development.
This is still a very small step… but it already makes the direction clearer:
Go talks to the OS… and the frontend talks to Go.
Here’s the demo video…