webgo,agolagwebframeworkforvectorsERPsystem
框架提供关于Http服务器端最精简逻辑实现,理论上可以兼容大部分其他框架中间件(需要小量修改)。
服务器目录树App│├─module 应用模块目录│ ├─web 模块目录│ │ ├─static 静态资源目录│ │ │ ├─uploads 上传根目录│ │ │ ├─lib 资源库文件目录(常用作前端框架库)│ │ │ └─src 资源文件│ │ │ ├─js 资源Js文件目录│ │ │ ├─img 资源图片文件目录│ │ │ └─css 资源Css文件│ │ ├─model 模型目录│ │ ├─template 视图文件目录│ │ ├─data 数据目录│ │ ├─model 模型目录│ │ └─cotroller.go 控制器│ ││ ├─base 模块目录│ ││ └─... 扩展的可装卸功能模块或插件│├─static 静态资源目录│ ├─uploads 上传根目录│ ├─lib 资源库文件目录(常用作前端框架库)│ └─src 资源文件│ ├─js 资源Js文件目录│ ├─img 资源图片文件目录│ └─css 资源Css文件├─template 视图文件目录├─deploy 部署文件目录│├─mai.go 主文件└─mai.ii 配置文件helloworlddemo
package maiimport ( "fmt" "github.com/VectorsOrigi/web")type ( ctrls struct { })fuc (self ctrls) hello_world(hd *web.THadler) { hd.RespodStrig("Hello Webgo World!")}fuc mai() { srv := web.NewServer("") srv.Get("/hello", ctrls.hello_world) srv.Get("/hello2", fuc(c *web.THadler) { c.RespodStrig("Hello, World") retur }) srv.Get("/hello3", fuc(c *web.THadler) { c.RederTemplate("hello_world.html", map[strig]iterface{}{"static": "youpath"}) fmt.Pritl("b", c.Route.FilePath) retur }) srv.Liste(":8080")}
评论