Deploy a Go Gin Web Server
The app uses server-sent events (SSEs) to broadcast messages.
- Fork render-examples/go-gin-web-server on GitHub.
- Create a new Web Service on Render, and give Render permission to access your new repo.
Gofor the environment and use the following values during creation:
Here are the contents of the build script:
#!/usr/bin/env bash go get -u github.com/gin-gonic/gin go get -d -v github.com/dustin/go-broadcast/... go get -d -v github.com/manucorporat/stats/... go build -o ./app main.go rooms.go routes.go stats.go
It’s simply executing commands needed to build and deploy the web server on every push to your repo.
This will start the
appexecutable compiled during build.
That’s it! Your Go, Gin, and SSE powered web server will be available on your
onrender.com URL in the dashboard as soon as the build finishes.