27 lines
383 B
Go
27 lines
383 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"nefrace.ru/doomer/config"
|
|
"nefrace.ru/doomer/db"
|
|
)
|
|
|
|
func main() {
|
|
config.InitConfig()
|
|
db, err := db.NewDatabase()
|
|
if err != nil {
|
|
log.Fatalf("Cant open database: %v", err)
|
|
}
|
|
|
|
defer db.Close()
|
|
doomer := NewDoomer(db)
|
|
|
|
dp := NewDispatcher(doomer)
|
|
app := InitServer(":3000")
|
|
go func() {
|
|
log.Fatal(app.Run())
|
|
}()
|
|
log.Println(dp.Poll())
|
|
}
|