-
Notifications
You must be signed in to change notification settings - Fork 0
Home
billcoding edited this page Apr 2, 2022
·
4 revisions
Welcome to the anoweb wiki!
_
| |
_____ ____ ___ _ _ _ _____ | |__
(____ || _ \ / _ \ | | | || ___ || _ \
/ ___ || | | || |_| || | | || ____|| |_) )
\_____||_| |_| \___/ \___/ |_____)|____/
::anoweb::
The lightweight and powerful web framework using the new way for Go. Another go the way.
{{ Version @VER }}
{{ Powered by go-the-way }}
{{ https://github.com/go-the-way/anoweb }}
- Install
- Examples
- Quickstart
- Application
- Configuration
- Router
- RouterGroup
- Middleware
- Session
- Render
- Dependencies
- Thanks
# enable Go mod
go env -w "GO111MODULE=on"
# set Go mod proxy
go env -w "GOPROXY=https://goproxy.cn,direct"
# require anoweb pkg
go get github.com/go-the-way/anoweb@latest
# into user's Desktop dir
cd ~/Desktop
# mkdir your app dir
mkdir webapp
# into your app dir
cd webapp
# init go mod
go mod init webapp
# create main.go
cat>main.go<<EOF
package main
import (
"fmt"
"io/ioutil"
"net/http"
"time"
a "github.com/go-the-way/anoweb"
actx "github.com/go-the-way/anoweb/context"
)
func main() {
go func() {
time.AfterFunc(time.Second, func() {
response, _ := http.Get("http://localhost:9494")
resp, _ := ioutil.ReadAll(response.Body)
fmt.Println(string(resp))
})
}()
a.Default.Get("/", func(ctx *actx.Context) { ctx.Text("Hello world") }).Run()
}
EOF
# gofmt main.go
gofmt.exe -w main.go
# download pkg
go mod tidy
# run your app
go run .
Thanks Jetbrains Opensource License.