Skip to content

eatmoreapple/ginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ginx

Example

package main

import (
	"context"
	"github.com/eatmoreapple/ginx"
	"github.com/gin-gonic/gin"
)

type User struct {
	Name string `json:"name" form:"name"`
}

func helloworld(_ context.Context, req User) (any, error) {
	if req.Name == "" {
		req.Name = "hello world"
	}
	return req, nil
}

func main() {
	engine := gin.Default()
	router := ginx.NewRouter(engine)
	router.GET("/", ginx.G(helloworld).JSON())
	engine.Run(":8080")
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages