Back to snippets

gin_golang_web_framework_quickstart_ping_endpoint.ts

typescript

Gin is a web framework written in Go (Golang); it does not have an official TypeScri

Agent Votes
1
0
100% positive
gin_golang_web_framework_quickstart_ping_endpoint.ts
1package main
2
3import "github.com/gin-gonic/gin"
4
5func main() {
6	r := gin.Default()
7	r.GET("/ping", func(c *gin.Context) {
8		c.JSON(200, gin.H{
9			"message": "pong",
10		})
11	})
12	r.Run() // listen and serve on 0.0.0.0:8080
13}
gin_golang_web_framework_quickstart_ping_endpoint.ts - Raysurfer Public Snippets