Skip to content

Go Hello World

Create a file named main.go with the following content:

package main
import "github.com/gin-gonic/gin"
func main() {
r := gin.Default()
r.GET("/", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "Hello World",
})
})
r.Run()
}

Run it locally:

Terminal window
go mod init hello-world
go mod tidy
go run main.go
Terminal window
curl http://localhost:8080
# {"message":"Hello World"}

Ready to deploy? Use the Origin Clouds CLI or SDK to push your app.

Deploy to Origin Clouds →