Example #1
0
File: errors.go Project: hraban/web
func main() {
	web.Get("/", root)
	web.Get("/404", notfound)
	web.Get("/teapot", teapot)
	web.Get("/generic", generic)
	web.Run("0.0.0.0:8081")
}
Example #2
0
File: params.go Project: hraban/web
func main() {
	web.Get("/", root)
	web.Post("/process", process)
	web.Run("127.0.0.1:9999")
}
Example #3
0
func main() {
	web.Config.CookieSecret = "7C19QRmwf3mHZ9CPAaPQ0hsWeufKd"
	web.Get("/", root)
	web.Post("/say", say)
	web.Run("127.0.0.1:9999")
}
Example #4
0
func main() {
	web.AddWrapper(web.CompressWrapper)
	web.Get("/", root)
	web.Run("127.0.0.1:9999")
}
Example #5
0
func main() {
	web.Get("/(.*)", hello)
	// You can create an example cert using generate_cert.go include in pkg crypto/tls
	web.RunTLS(":9999", "/tmp/cert.pem", "/tmp/key.pem")
}
Example #6
0
func main() {
	// Add AuthHandler to our PreModule list
	web.AddPreModule(AuthHandler)
	web.Get("/(.*)", Hello)
	web.Run("0.0.0.0:9999")
}
Example #7
0
func main() {
	web.Get("/", index)
	web.Post("/multipart", multipart)
	web.Run("0.0.0.0:9999")
}
Example #8
0
File: hello.go Project: hraban/web
func main() {
	web.Get("/(.*)", hello)
	web.Run("127.0.0.1:9999")
}
Example #9
0
func main() {
	web.Get("/", root)
	web.Get("/a", a)
	web.Get("/b", b)
	web.Get("/c", c)
	web.Get("/d", d)
	web.Get("/e", e)
	web.Get("/f", myhandlertype("return io.Reader"))
	web.Get("/g", g)
	web.Get("/h", h)
	web.Get("/i", i)
	web.Get("/j", j)
	web.Run("127.0.0.1:9999")
}