-
Notifications
You must be signed in to change notification settings - Fork 250
/
router.go
32 lines (30 loc) · 973 Bytes
/
router.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* desc : 系统功能路由注册
* author:畅雨
* date: 2016.05.16
* history:
*
*/
package router
import (
"github.com/andeya/faygo"
"github.com/andeya/faygo/ext/db/directsql"
"github.com/andeya/faygo/samples/directsql/handler"
)
// Register the system router in a chain style
func Route(frame *faygo.Framework) {
faygo.SetUpload("./upload", false, false)
faygo.SetStatic("./static", false, false)
// Home page
frame.NamedAPI("Home", "GET", "/", handler.Index())
// bos 执行SQL定义的路由
frame.NamedAPI("DirectSQL", "POST", "/bos/*path", directsql.DirectSQL())
frame.NamedGET("DirectSQL ModelSql Reload", "/bom/reloadall", directsql.DirectSQLReloadAll())
frame.NamedGET("DirectSQL ModelSql Reload", "/bom/reload/*path", directsql.DirectSQLReloadModel())
frame.NamedAPI("Pongo2", "GET", "/pongo2", handler.Pongo2())
frame.NamedStaticFS("render", "/tpl", faygo.RenderFS(
"./view",
".tpl", // "*"
faygo.Map{"title": "tpl page"},
))
}