<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          WebgoGo 實現(xiàn)的 Web 框架

          聯(lián)合創(chuàng)作 · 2023-09-20 04:33

          webgo,a golang web framework for vectors ERP system

          框架提供關(guān)于 Http 服務(wù)器端最精簡邏輯實現(xiàn),理論上可以兼容大部分其他框架中間件(需要小量修改)。

          服務(wù)器目錄樹
          App
          │
          ├─module 應(yīng)用模塊目錄
          │  ├─web 模塊目錄
          │  │  ├─static 靜態(tài)資源目錄
          │  │  │   ├─uploads 上傳根目錄
          │  │  │   ├─lib 資源庫文件目錄(常用作前端框架庫)
          │  │  │   └─src 資源文件
          │  │  │      ├─js 資源Js文件目錄
          │  │  │      ├─img 資源圖片文件目錄
          │  │  │      └─css 資源Css文件
          │  │  ├─model 模型目錄
          │  │  ├─template 視圖文件目錄
          │  │  ├─data 數(shù)據(jù)目錄
          │  │  ├─model 模型目錄
          │  │  └─controller.go 控制器
          │  │
          │  ├─base 模塊目錄
          │  │
          │  └─... 擴展的可裝卸功能模塊或插件
          │
          ├─static 靜態(tài)資源目錄
          │  ├─uploads 上傳根目錄
          │  ├─lib 資源庫文件目錄(常用作前端框架庫)
          │  └─src 資源文件
          │     ├─js 資源Js文件目錄
          │     ├─img 資源圖片文件目錄
          │     └─css 資源Css文件
          ├─template 視圖文件目錄
          ├─deploy 部署文件目錄
          │
          ├─main.go 主文件
          └─main.ini 配置文件

          hello world demo

          package main
          
          import (
            "fmt"
          
            "github.com/VectorsOrigin/web"
          )
          
          type (
            ctrls struct {
            }
          )
          
          func (self ctrls) hello_world(hd *web.THandler) {
            hd.RespondString("Hello Webgo World!")
          }
          
          func main() {
            srv := web.NewServer("")
            srv.Get("/hello", ctrls.hello_world)
            srv.Get("/hello2", func(c *web.THandler) {
              c.RespondString("Hello, World")
              return
            })
          
            srv.Get("/hello3", func(c *web.THandler) {
              c.RenderTemplate("hello_world.html", map[string]interface{}{"static": "youpath"})
              fmt.Println("b", c.Route.FilePath)
              return
            })
          
            srv.Listen(":8080")
          }
          瀏覽 22
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  AAA黄片 | 色五月丁香在线 | 亚洲欧美高清在线观看 | 高清免费无码 | 影视先锋成人在线 |