Skip to content

Instantly share code, notes, and snippets.

@jsonw23
Created April 4, 2022 18:45
Show Gist options
  • Save jsonw23/a5cb8dc7cd21db7bfc586520fea1bfa5 to your computer and use it in GitHub Desktop.
Save jsonw23/a5cb8dc7cd21db7bfc586520fea1bfa5 to your computer and use it in GitHub Desktop.
package main
import (
"github.com/gin-gonic/gin"
"github.com/jsonw23/copilot-react-admin/middleware"
)
func main() {
r := gin.Default()
// use the auth middleware
r.Use(middleware.Auth(r))
r.GET("/", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "Hello, World",
})
})
r.Run()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment