1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-14 17:20:56 +00:00
Commit Graph

157 Commits

Author SHA1 Message Date
astaxie
0f170a80da update the comments fix #658 2014-06-25 10:39:37 +08:00
astaxie
af4f153830 beego: update the router rule for *
* not match the empty route
2014-06-21 11:44:24 +08:00
astaxie
085c362ffb beego:fix router expge 2014-06-18 23:32:47 +08:00
astaxie
117904be73 beego:fix the some regexp routes to different func 2014-06-12 23:08:05 +08:00
astaxie
c13141b8bf beego:fix when user defined function equal to HTTP 2014-06-11 22:45:54 +08:00
astaxie
3db9633ebd remove websocket logic because not support handler 2014-06-11 11:12:17 +08:00
astaxie
6809c97611 beego: improve performance 2014-06-11 01:11:32 +08:00
astaxie
4786fb0948 beego:fix typo NewControllerRegister 2014-06-10 20:12:57 +08:00
astaxie
107a7a21c0 beego: dev mode print request router & pattern 2014-06-10 18:09:07 +08:00
astaxie
f7b01aab13 beego: modify the filter sequence 2014-06-10 11:02:41 +08:00
astaxie
2570f075d9 beego:change ControllerComments exported 2014-06-09 17:46:13 +08:00
astaxie
21cb8ea4a3 beego:AST code 2014-06-09 17:33:04 +08:00
astaxie
6c8a7f1382 beego: router change to method Tree 2014-06-09 10:11:37 +08:00
astaxie
e00eab7f49 beego: change to tree 2014-06-08 20:24:07 +08:00
astaxie
5dee6b7d19 beego: fix the namespace cond 2014-05-28 10:23:31 +08:00
astaxie
f6c7a6bd32 beego: improve the admin router print 2014-05-27 17:27:22 +08:00
astaxie
3f7e91e6a4 beego:fix *.* router bug 2014-05-26 10:15:56 +08:00
astaxie
0d17d974cd beego: update namespace 2014-05-23 15:56:25 +08:00
astaxie
17104c25a2 beego: Refactoring Filter & add comments 2014-05-20 18:47:41 +08:00
astaxie
9f01aeed31 beego:remove unused code 2014-05-19 18:52:48 +08:00
astaxie
c5c806b58e beego: XSRF support Controller level fix #610
default value is true when you Enable Global XSRF, also can control in
the prepare function to change the value.
2014-05-17 02:26:51 +08:00
astaxie
e657dcfd5f beego: support namespace
ns := beego.NewNamespace("/v1/api/")
ns.Cond(func(ctx *context.Context)bool{
	    if ctx.Input.Domain() == "www.beego.me" {
	    	return true
	    }
	    return false
	})
.Filter("before", Authenticate)
.Router("/order",	&admin.OrderController{})
.Get("/version",func (ctx *context.Context) {
	ctx.Output.Body([]byte("1.0.0"))
})
.Post("/login",func (ctx *context.Context) {
	if ctx.Query("username") == "admin" && ctx.Query("username") ==
"password" {

	}
})
.Namespace(
	NewNamespace("/shop").
		Get("/order/:id", func(ctx *context.Context) {
		ctx.Output.Body([]byte(ctx.Input.Param(":id")))
	}),
)
2014-05-17 02:26:51 +08:00
astaxie
55ad951bce beego: support more router
//design model
	beego.Get(router, beego.FilterFunc)
	beego.Post(router, beego.FilterFunc)
	beego.Put(router, beego.FilterFunc)
	beego.Head(router, beego.FilterFunc)
	beego.Options(router, beego.FilterFunc)
	beego.Delete(router, beego.FilterFunc)
	beego.Handler(router, http.Handler)

//example

beego.Get("/user", func(ctx *context.Context) {
	ctx.Output.Body([]byte("Get userlist"))
})

beego.Post("/user", func(ctx *context.Context) {
	ctx.Output.Body([]byte("add userlist"))
})

beego.Delete("/user/:id", func(ctx *context.Context) {
	ctx.Output.Body([]byte([]byte(ctx.Input.Param(":id")))
})

import (
    "http"
    "github.com/gorilla/rpc"
    "github.com/gorilla/rpc/json"
)

func init() {
    s := rpc.NewServer()
    s.RegisterCodec(json.NewCodec(), "application/json")
    s.RegisterService(new(HelloService), "")
    beego.Handler("/rpc", s)
}
2014-05-17 02:26:51 +08:00
astaxie
3b9a404138 beego: support other analisys & fix typo 2014-05-17 02:26:50 +08:00
astaxie
c188cbbcb4 update all files License 2014-05-17 02:26:50 +08:00
astaxie
4245521660 fix #576 2014-05-17 02:26:50 +08:00
astaxie
aa68ffecec beego: support not-empty value in router fix #555 2014-05-17 02:26:50 +08:00
astaxie
3255a43568 beego: move staticServer to New file 2014-04-06 00:18:21 +08:00
asta.xie
9c959fba4d fix string 2014-03-29 14:59:55 +08:00
asta.xie
5588bfc35e support filter to get router. get runController & runMethod 2014-03-29 14:55:34 +08:00
astaxie
5d392b76c7 Merge pull request #531 from unphp/develop
Update router.go
2014-03-14 10:08:47 +08:00
asta.xie
769f7c751b fix static file route 2014-03-12 21:06:20 +08:00
asta.xie
624f6258ee fix read / 2014-03-12 18:29:45 +08:00
unphp
43c977ab62 Update router.go
To append a slice's value into "exceptMethod", for controller's methods shouldn't reflect to AutoRouter
2014-03-12 17:20:53 +08:00
asta.xie
6c92ca2a16 fix bug for static file like /static /static_js /static_css 2014-03-12 17:03:34 +08:00
asta.xie
f7430a2ce1 enhance the static file path. If user foget / path.Join will auto fix it. 2014-03-12 15:56:05 +08:00
asta.xie
04a19685ed enhance the static file path. If user foget / path.Join will auto fix it. 2014-02-26 14:44:41 +08:00
slene
6e9ba0ea7f fix SessionRegenerateID should release old SessionStore and release new SessionStore in router.go 2014-01-11 17:01:33 +08:00
astaxie
31bdb793cf make fix 2014-01-05 15:21:50 +08:00
astaxie
d57557dc55 add AutoRouterWithPrefix 2014-01-01 17:57:57 +08:00
astaxie
1e57587fe9 support Hijacker #428 2013-12-31 20:47:48 +08:00
astaxie
a1e29b0b75 Merge pull request #422 from pengfei-xue/devel
simplify condition test for trailing /
2013-12-30 04:58:50 -08:00
astaxie
984b0cbf31 1. :all param default expr change from (.+) to (.*)
2. add hookfunc to support appstart hook
2013-12-30 15:06:51 +08:00
Pengfei Xue
3a08eec1f9 simplify condition test for trailing / 2013-12-30 11:29:35 +08:00
astaxie
95dc670eb4 fix #416 2013-12-28 23:06:20 +08:00
astaxie
7a3d05ebf3 when pattern is /admin while the url is /admin/ should return 200. fix #416 2013-12-28 23:04:45 +08:00
astaxie
0b659961ba clearly the router, If user set the third params, will not follow the RESTful method 2013-12-24 15:27:00 +08:00
傅小黑
ff18ae2562 add api comments in file memzipfile.go,reload.go,router.go,template.go and templatefunc.go, fix spelling error GetInitListner as GetInitListener. 2013-12-21 13:19:24 +08:00
astaxie
57781d1001 when panic show the request url 2013-12-21 01:20:35 +08:00
astaxie
419c3fc772 remove contextBuffer fix #396 2013-12-21 00:34:59 +08:00