Skip to content

Instantly share code, notes, and snippets.

@digitallysavvy
Last active August 7, 2020 20:42
Show Gist options
  • Save digitallysavvy/d92e7743d2c838c64686dc8209cde9b1 to your computer and use it in GitHub Desktop.
Save digitallysavvy/d92e7743d2c838c64686dc8209cde9b1 to your computer and use it in GitHub Desktop.
a very basic web service using GoLang and the Gin framework
package main
import (
"github.com/gin-gonic/gin"
)
func main() {
api := gin.Default()
api.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
api.Run(":8080") // listen and serve on localhost:8080
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment