web.go is the simplest way to write web applications in the Go programming language. It's ideal for writing simple, performant backend web services.
Overview
web.go should be familiar to people who've developed websites with higher-level web frameworks like sinatra or web.py. It is designed to be a lightweight web framework that doesn't impose any scaffolding on the user. Some features include:- Routing to url handlers based on regular expressions
- Secure cookies
- Support for fastcgi and scgi
- Web applications are compiled to native code. This means very fast execution and page render speed
- Efficiently serving static files
Installation
Make sure you have the a working Go environment. See the install instructions. web.go targets the Gorelease
branch.To install web.go, simply run:
go get github.com/hoisie/web
To compile it from source:git clone git://github.com/hoisie/web.git
cd web && go build
Example
package main
import (
"github.com/hoisie/web"
)
func hello(val string) string { return "hello " + val }
func main() {
web.Get("/(.*)", hello)
web.Run("0.0.0.0:9999")
}
go run hello.go
You can point your browser to http://localhost:9999/world .from https://github.com/hoisie/web