Beego -- 路由
路由
func init() {
// 如果有指定参数,必须指定对应方法才会匹配对应方法处理,否则访问不到,
// 例如:如果不写post 则访问不到POST方法,以分号分割
beego.Router("/", &controllers.MainController{},"get:方法名;post:方法名") // 指定get请求 匹配对应的方法
}
python防脱发技巧
func init() {
// 如果有指定参数,必须指定对应方法才会匹配对应方法处理,否则访问不到,
// 例如:如果不写post 则访问不到POST方法,以分号分割
beego.Router("/", &controllers.MainController{},"get:方法名;post:方法名") // 指定get请求 匹配对应的方法
}