Skip to content

Instantly share code, notes, and snippets.

@maxmcd
Forked from skaffen2/main.go
Last active November 9, 2015 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxmcd/01e4e554149bf2eab3a2 to your computer and use it in GitHub Desktop.
Save maxmcd/01e4e554149bf2eab3a2 to your computer and use it in GitHub Desktop.
Gitbaotest
package main
import (
"fmt"
"net/http"
"time"
"github.com/maxmcd/baodata"
)
func main() {
baodata.Put("/users", baodata.Data{"email": "git@gitbao.com"})
http.HandleFunc("/",
func(w http.ResponseWriter, req *http.Request) {
w.Write([]byte(fmt.Sprintf("Gitbao is awesome at %s", time.Now())))
resp, _ := baodata.Get("/users")
w.Write([]byte(fmt.Sprintf("users: %s", resp)))
})
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment