-
Notifications
You must be signed in to change notification settings - Fork 259
/
router.go
32 lines (30 loc) · 979 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("DirectSQLX", "POST", "/bosx/*path", directsql.DirectSQL())
frame.NamedGET("DirectSQLX ModelSql Reload", "/bomx/reloadall", directsql.DirectSQLReloadAll())
frame.NamedGET("DirectSQLX ModelSql Reload", "/bomx/reload/*path", directsql.DirectSQLReloadModel())
frame.NamedAPI("Pongo2", "GET", "/pongo2", handler.Pongo2())
frame.NamedStaticFS("render", "/tpl", faygo.RenderFS(
"./view",
".tpl", // "*"
faygo.Map{"title": "tpl page"},
))
}