Orange框架

2021-03-02  本文已影响0人  夸克星

go 1.15
.zshrc 配置 $GOPATH

go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct

download src

sudo git clone https://gitee.com/zhucheer/orange $GOPATH/src/gitee.com/zhucheer/orange
cd $GOPATH/src/gitee.com/zhucheer/orange
sudo go install

一个main 搞定的Demo:

package main

import "gitee.com/zhucheer/orange/app"

func main(){
    router := &Route{}
    app.AppStart(router)
}

type Route struct {
}


func (s *Route) ServeMux(){
    app.NewRouter("").GET("/",func(ctx *app.Context) error{
        return ctx.ToString("Hello world!")
    })
}

func (s *Route) Register(){

}
上一篇 下一篇

猜你喜欢

热点阅读