package main

import (
	"fmt"
	"log"
	"nbarest/lib/persistence/mongolayer"
	"nbarest/nbaservice/rest"
	"net/http"
)

func main(){
	dbhandler,err:= mongolayer.NewMongoDBLayer("mongodb://mongodb:27017")
	if err!=nil{
		log.Fatal(err)
	}
	log.Fatal(rest.ServeAPI(":8181",dbhandler))

	//r:=mux.NewRouter()
	//http.Handle("/",r)
	//
	//r.HandleFunc("/test",TestHandler)
	//
	//http.ListenAndServe(":8181",r)

}


func TestHandler(w http.ResponseWriter,r *http.Request){
	fmt.Fprintln(w,"connect")
}
