0PricingLogin
Go Academy · Lesson

Gin Router and Route Groups

Engine setup, groups, and path parameters

What is Gin?

Gin is a high-performance HTTP web framework for Go. It uses a radix tree router, provides middleware support, JSON binding, and validation — making it popular for REST APIs.

Installing and basic setup

Import and create a Gin engine:

go get github.com/gin-gonic/gin

package main

func main() {
    r := gin.Default()
    r.GET("/ping", func(c *gin.Context) {
        c.JSON(200, gin.H{"message": "pong"})
    })
    r.Run(":8080")
}

All lessons in this course

  1. Gin Router and Route Groups
  2. Request Binding and Validation
  3. Response Helpers and Status Codes
  4. Gin Middleware: Auth and Logging
← Back to Go Academy