1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-19 04:20:54 +00:00
Commit Graph

30 Commits

Author SHA1 Message Date
astaxie
f96a6285bf fix #978 2015-02-27 22:21:58 +08:00
astaxie
716962672f fix #751
add config ListenTCP4

when user want to listen on the TCP4, because now almost use the ipv4.
but default lister on the ipv6
2014-11-03 15:06:25 +08:00
Jens Bissinger
812950b60d Allow to use fastcgi via standard io. 2014-10-13 13:47:44 +02:00
astaxie
f7cd1479ba beego: improve the log debug for running server 2014-09-05 17:04:02 +08:00
astaxie
a144769515 update the documents & comments 2014-08-18 16:41:43 +08:00
astaxie
0836b9e13f fix #718 2014-08-01 17:03:28 +08:00
astaxie
fefd8ddb5b beego: update licence& fix #669 2014-07-03 23:40:21 +08:00
astaxie
0f170a80da update the comments fix #658 2014-06-25 10:39:37 +08:00
astaxie
4786fb0948 beego:fix typo NewControllerRegister 2014-06-10 20:12:57 +08:00
astaxie
33ad6c1370 beego: remove app funciont & fix #590
config := tls.Config{
    ClientAuth: tls.RequireAndVerifyClientCert,
    Certificates: []tls.Certificate{cert},
    ClientCAs: pool,
}
config.Rand = rand.Reader

beego.BeeApp.Server. TLSConfig = &config
2014-05-20 17:28:06 +08:00
astaxie
04290dfc68 beego: delete hotupdate 2014-05-20 16:41:39 +08:00
astaxie
f215aa4810 beego: change the error tips 2014-05-20 15:34:27 +08:00
astaxie
18a02d7d60 beego:support https & http listen 2014-05-20 15:30:17 +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
c188cbbcb4 update all files License 2014-05-17 02:26:50 +08:00
Francois
bc2f1fb79d Update app.go 2014-05-13 17:19:50 +02:00
astaxie
d57557dc55 add AutoRouterWithPrefix 2014-01-01 17:57:57 +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
傅小黑
ce332713c4 gofmt commented go files 2013-12-20 22:35:16 +08:00
傅小黑
933e98e4f2 add api comments in file beego.go 2013-12-20 19:36:54 +08:00
傅小黑
3f3bf299a6 add api comments in file app.go 2013-12-20 19:20:13 +08:00
vadimi
12a37f71be Fixed some typos 2013-12-04 22:27:29 -05:00
astaxie
3c91360d72 dictinct system pkg and third pkg 2013-12-03 21:37:39 +08:00
Pengfei Xue
e823b6ea95 add server host:port info when starting app 2013-11-26 15:30:59 +08:00
knightmare
47fc32ba47 add func InsertFilter(pattern string, pos int, filter FilterFunc) *App to replace AddFilter
pos can be const:
    BeforeRouter = iota
    AfterStatic
    BeforeExec
    AfterExec
    FinishRouter
2013-11-25 15:59:40 +08:00
astaxie
a981dab536 fix #286
the process exit and the channel info can't flush to console
2013-11-13 21:11:08 +08:00
astaxie
9446563e5b add util func to get the url fix #282
UrlFor(endpoint string, values ...string) string
2013-11-10 23:05:07 +08:00
astaxie
63da329468 go on modify api 2013-09-10 00:17:49 +08:00
astaxie
bd61dd9ffc change a log about new version 2013-09-10 00:00:18 +08:00