package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func main() {
	r := gin.Default()
	r.GET("/query", func(c *gin.Context) {
		username := c.Query("username")
		c.JSON(http.StatusOK, gin.H{
			"username": username,
		})
	})
	r.Run()
	// http://localhost:8080/query?username=gin
	// {"username":"gin"}
}