-
Notifications
You must be signed in to change notification settings - Fork 228
/
goji.go
36 lines (28 loc) · 1002 Bytes
/
goji.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
Package goji provides an out-of-box web server with reasonable defaults.
Example:
package main
import (
"fmt"
"net/http"
"github.com/zenazn/goji"
"github.com/zenazn/goji/web"
)
func hello(c web.C, w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, %s!", c.URLParams["name"])
}
func main() {
goji.Get("/hello/:name", hello)
goji.Serve()
}
This package exists purely as a convenience to programmers who want to get
started as quickly as possible. It draws almost all of its code from goji's
subpackages, the most interesting of which is goji/web, and where most of the
documentation for the web framework lives.
A side effect of this package's ease-of-use is the fact that it is opinionated.
If you don't like (or have outgrown) its opinions, it should be straightforward
to use the APIs of goji's subpackages to reimplement things to your liking. Both
methods of using this library are equally well supported.
Goji requires Go 1.2 or newer.
*/
package goji