added sql storage

This commit is contained in:
sm
2013-12-21 00:26:54 -08:00
parent c7f600f8e7
commit 5732f06932
5 changed files with 81 additions and 11 deletions
+6 -1
View File
@@ -3,13 +3,17 @@ package main
import (
"flag"
"fmt"
"github.com/jmoiron/sqlx"
"github.com/kelseyhightower/envconfig"
_ "github.com/lib/pq"
"log"
"net/http"
)
var verbose = flag.Bool("verbose", false, "increase logging verbosity")
var db *sqlx.DB
func main() {
flag.Parse()
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
@@ -21,7 +25,8 @@ func main() {
if err := config.validate(); err != nil {
log.Fatal(err)
}
log.Printf("%+v", config)
log.Printf("config: %#v", config)
dbSetup(config)
http.Handle("/api/v0/info/", JsonHandler(apiInfo))
http.Handle("/api/v0/put/", JsonHandler(put))