Skip to content

Instantly share code, notes, and snippets.

@gravityblast
Created December 18, 2014 12:05
Show Gist options
  • Save gravityblast/f06b55375ffb4e3a41e1 to your computer and use it in GitHub Desktop.
Save gravityblast/f06b55375ffb4e3a41e1 to your computer and use it in GitHub Desktop.
package main
import "github.com/pilu/traffic"
func root(w traffic.ResponseWriter, r *traffic.Request) {
user := map[string]string{
"name": "foo",
}
w.WriteJSON(user)
}
func main() {
t := traffic.New()
t.Get("/", root)
t.Run()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment