You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
551 B

2 years ago
package main
import (
2 years ago
"fmt"
"git.diulo.com/mogfee/protoc-gen-kit/example/service"
2 years ago
"git.diulo.com/mogfee/protoc-gen-kit/log"
2 years ago
"git.diulo.com/mogfee/protoc-gen-kit/middleware"
user "git.diulo.com/mogfee/protoc-gen-kit/proto/v1"
2 years ago
"github.com/gin-gonic/gin"
)
func main() {
2 years ago
gin.SetMode(gin.ReleaseMode)
2 years ago
app := gin.Default()
srv := service.UserService{}
2 years ago
logger := log.With(log.DefaultLogger)
user.RegisterUserHandler(app, &srv, middleware.Logger(logger), middleware.Validate())
2 years ago
fmt.Println("http://localhost:8888")
2 years ago
app.Run("localhost:8888")
}