Skip to content

Repository files navigation

web

A Go web app framework with views for constructing web pages, supports CGI & FCGI.

package main
import (
"web""fmt""os"
)
varcounter=0funchello(request*web.Request, response*web.Response) (err os.Error) {
counter+=1response.Header.Set("Content-Type", "text/html")
fmt.Fprintf(response.BodyWriter, "<b>test</b>: <small>num=%d</small><br/>\n", counter)
return
}
funcmain() {
m, err:=web.NewFCGIModel()
iferr!=nil {
fmt.Printf("%v\n", err)
return
}
app, err:=web.NewApp(m)
iferr!=nil {
fmt.Printf("%v\n", err)
return
}
ifapp==nil {
fmt.Printf("no app\n")
return
}
app.HandleDefault(web.FuncHandler(hello))
app.Exec()
}

About

A Go web app framework with views for constructing web pages, supports CGI & FCGI.

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages