Skip to content

Commit c31ca54

Browse files
committed
www add *
1 parent 7d2e056 commit c31ca54

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

www/main/main.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
package main
22

33
import (
4+
"github.com/gin-gonic/gin"
45
"github.com/ltto/T/www"
56
"github.com/ltto/T/www/rest"
67
)
78

89
func main() {
910
www.Get("/hello", func(c *www.Context) interface{} {
10-
return rest.ReturnFile("/Users/liutongtong/gocode/T/www/main/rgb.png")
11+
return rest.ReturnRedirect("https://www.baidu.com")
1112
})
1213

14+
www.Get("/ok", func(c *www.Context) string {
15+
return "OK"
16+
})
17+
www.Get("/json", func(c *www.Context) gin.H {
18+
return gin.H{"json": "ok"}
19+
})
1320
www.Run()
1421
}

0 commit comments

Comments
 (0)