web.go is the simplest way to write web applications in the Go programming language.
web.go should be familiar to people who've developed websites with higher-level web frameworks like sinatra, pylons, 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 ( benchmarks coming soon :)
- Serving static files
- Make sure you have the a working Go environment. See the install instructions. web.go will always compile on the
release
tag. - git clone git://github.com/hoisie/web.go.git
- cd web.go && make install
Or simply run goinstall github.com/hoisie/web.go
package main
import (
"web"
)
func hello(val string) string { return "hello " + val }
func main() {
web.Get("/(.*)", hello)
web.Run("0.0.0.0:9999")
}
To run the application, put the code in a file called hello.go and run:
8g hello.go && 8l -o hello hello.8 && ./hello
You can point your browser to http://localhost:9999/world .
For a quickstart guide, check out web.go's home page
There is also a tutorial
If you use web.go, I'd greatly appreciate a quick message about what you're building with it. This will help me get a sense of usage patterns, and helps me focus development effors on features that people will actually use.
web.go was written by Michael Hoisie.
Follow me on Twitter!