Go Applications
Deploy high-performance Go APIs and backend services with automatic builds and scaling.
Overview
RunxBuild builds your Go application automatically from your repository. Your service must listen on the port provided via the PORT environment variable.
Files RunxBuild Looks For
RunxBuild detects Go module projects using your module definition. Keep these files in your repository root for best results.
go.mod (recommended):
module runxbuild-service
go 1.25.0
This file is generated by Go tooling and should be committed for reproducible dependency installs.
Basic Go Template
package main
import (
"encoding/json"
"log"
"net/http"
"os"
)
func main() {
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]string{
"message": "RunxBuild Go Service running",
})
})
log.Printf("Server running on %s\n", port)
log.Fatal(http.ListenAndServe("0.0.0.0:"+port, nil))
}
Deployment Settings
- Build Command: (leave empty)
- Predeploy Command: (leave empty)
- Output Directory: (leave empty)
- Start Command: (leave empty)