mirror of
https://github.com/astaxie/beego.git
synced 2024-11-23 18:00:54 +00:00
commit
40f7a56bf5
23
README.md
23
README.md
@ -4,29 +4,18 @@
|
||||
beego is used for rapid development of RESTful APIs, web apps and backend services in Go.
|
||||
It is inspired by Tornado, Sinatra and Flask. beego has some Go-specific features such as interfaces and struct embedding.
|
||||
|
||||
###### More info at [beego.me](http://beego.me).
|
||||
[Officail website](http://beego.me)
|
||||
[Example](https://github.com/beego-dev/beego-example)
|
||||
|
||||
> If you could not open this website, go to [beedoc](https://github.com/beego/beedoc)
|
||||
> If you could not open official website, go to [beedoc](https://github.com/beego/beedoc)
|
||||
|
||||
## beego 1.x and 2.x
|
||||
|
||||
We recently release beego 2.0.0-beta, and its structure change a lot, so you may get some error
|
||||
|
||||
1. If you are working on beego v1.x please try `go get github.com/astaxie/beego@v1.12.3`
|
||||
2. If you want to try beego 2.0.0, run `go get github.com/astaxie/beego@develop`
|
||||
|
||||
We are still working on fix bug and documentation of v2.x. And v2.x's doc will be released with v2.0.0.
|
||||
|
||||
## Next version
|
||||
|
||||
v1.12.4 will be released on Jan 2021 And v2.0.0 will be released next month.
|
||||
2. If you want to try beego 2.0.0, run `go get github.com/astaxie/beego@v2.0.0`
|
||||
|
||||
## Quick Start
|
||||
|
||||
###### Please see [Documentation](http://beego.me/docs) for more.
|
||||
|
||||
###### [beego-example](https://github.com/beego-dev/beego-example)
|
||||
|
||||
### Web Application
|
||||
|
||||
#### Create `hello` directory, cd `hello` directory
|
||||
@ -40,9 +29,7 @@ v1.12.4 will be released on Jan 2021 And v2.0.0 will be released next month.
|
||||
|
||||
#### Download and install
|
||||
|
||||
go get -u github.com/astaxie/beego@develop
|
||||
|
||||
Now we are working on beego v2.0.0, so using `@develop`.
|
||||
go get github.com/astaxie/beego@v2.0.0
|
||||
|
||||
#### Create file `hello.go`
|
||||
```go
|
||||
|
@ -28,5 +28,5 @@ var (
|
||||
|
||||
const (
|
||||
// VERSION represent beego web framework version.
|
||||
VERSION = "2.0.0-alpha"
|
||||
VERSION = "2.0.0"
|
||||
)
|
||||
|
@ -149,7 +149,8 @@ func (ctx *Context) XSRFToken(key string, expire int64) string {
|
||||
token, ok := ctx.GetSecureCookie(key, "_xsrf")
|
||||
if !ok {
|
||||
token = string(utils.RandomCreateBytes(32))
|
||||
ctx.SetSecureCookie(key, "_xsrf", token, expire, "", "", true, true)
|
||||
// TODO make it configurable
|
||||
ctx.SetSecureCookie(key, "_xsrf", token, expire, "", "")
|
||||
}
|
||||
ctx._xsrfToken = token
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user