import (
"fmt"
http "net/http"
"path/filepath"
"strings"
"github.com/astaxie/beego"
)
type MainController struct {
beego.Controller
}
func (this *MainController) Get() {
//this.Ctx.Request.URL= http://127.0.0.1/crossdomain.xml
orpath := this.Ctx.Request.URL.Path
if strings.Index(orpath, "crossdomain.xml") >= 0 {
fmt.Println(orpath) // /crossdomain.xml
path := filepath.Join(`static`, "crossdomain.xml")
http.ServeFile(this.Ctx.ResponseWriter, this.Ctx.Request, path)
}
this.Ctx.WriteString("hello world" + orpath)
}
func (this *MainController) Post() {
name := this.GetString("name")
sex := this.GetString("sex")
this.Ctx.WriteString(name + sex+"成功")
fmt.Println(name + sex)
}
func main() {
beego.Router("/*", &MainController{})
beego.Run()
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有