package main

import (
	"flag"
	"net/http"

	"github.com/golang/glog"

	"xinu.tv/email/db"
	"xinu.tv/email/handlers"
)

var addr = flag.String("addr", ":8080", "address:port to listen on")

func main() {
	defer glog.Flush()
	flag.Parse()

	c, err := db.NewConn("")
	if err != nil {
		glog.Fatal(err)
	}

	h := handlers.Handlers(c)
	glog.Fatal(http.ListenAndServe(*addr, h))
}
