GoLang-Beego使用
生活随笔
收集整理的這篇文章主要介紹了
GoLang-Beego使用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.beego 注意事項
beego的默認架構是mvc python的django默認是mtv
package mainimport ("github.com/astaxie/beego" )type MainController struct {beego.Controller }func (this *MainController) Get(){this.Ctx.WriteString("hello mybeego") }func(this *MainController) Post(){user := this.GetString("username") //只能回去urlencode 為a=1&b=2格式//pwd := this.GetString("password")if user == ""{this.Ctx.WriteString("username not get,please check it")}else{this.Ctx.WriteString("111")}}func main(){beego.Router("/",&MainController{})beego.Run("127.0.0.1:9999") }
轉載于:https://www.cnblogs.com/liujiliang/p/10027229.html
總結
以上是生活随笔為你收集整理的GoLang-Beego使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一站式学习Redis 从入门到高可用分布
- 下一篇: luogu4407 [JSOI2009]