Skip to content
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 }}

CircleCI codecov Go Report Card GoDoc Release

Overview

Install

#  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

Quickstart

# 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 .

Dependencies

Thanks

Thanks Jetbrains Opensource License.

Clone this wiki locally