Skip to content

a restful web framework like tornado written by go

License

Notifications You must be signed in to change notification settings

llsheldon/polaris

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

polaris

a restful web framework like tornado written by go

see my chinese blog for more

Example

type Handler1 struct {

}

func (h *Handler1) Prepare(env *Env) {
    fmt.Println("hello prepare")
}

func (h *Handler1) Get(env *Env) {
    env.WriteString("hello world")
}

type Handler2 struct {

}

//id is a captured submatch for regexp url below
func (h *Handler2) Get(env *Env, id string) {
    env.WriteString("hello " + id)
}

app := NewApp(configFile)

app.Handle("/handler1", new(Handler1))
app.Handle("/handler2/([0-9]+)", new(Handler2))

app.Run()

Dependence

go get github.com/garyburd/redigo/redis

About

a restful web framework like tornado written by go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%