closes #44
This commit is contained in:
23
main.go
23
main.go
@@ -31,25 +31,24 @@ func main() {
|
||||
defer db.Close()
|
||||
fmt.Println("Starting server on :8000!")
|
||||
|
||||
//TODO check if file structure exists to save data
|
||||
//TODO check if file structure exists to save data
|
||||
handle := NewHandler(db)
|
||||
|
||||
_, err = db.Exec("update models set status=$1 where status=$2", models_utils.FAILED_TRAINING, models_utils.TRAINING);
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
_, err = db.Exec("update models set status=$1 where status=$2", models_utils.FAILED_TRAINING, models_utils.TRAINING)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// TODO Handle this in other way
|
||||
handle.StaticFiles("/styles/", ".css", "text/css");
|
||||
handle.StaticFiles("/js/", ".js", "text/javascript");
|
||||
handle.ReadFiles("/imgs/", "views", ".png", "image/png;");
|
||||
handle.ReadFiles("/savedData/", ".", ".png", "image/png;");
|
||||
handle.StaticFiles("/styles/", ".css", "text/css")
|
||||
handle.StaticFiles("/js/", ".js", "text/javascript")
|
||||
handle.ReadFiles("/imgs/", "views", ".png", "image/png;")
|
||||
handle.ReadTypesFiles("/savedData/", ".", []string{".png", ".jpeg"}, []string{"image/png", "image/jpeg"})
|
||||
|
||||
handle.GetHTML("/", AnswerTemplate("index.html", nil, 0))
|
||||
|
||||
usersEndpints(db, handle)
|
||||
HandleModels(handle)
|
||||
usersEndpints(db, handle)
|
||||
HandleModels(handle)
|
||||
|
||||
handle.Startup()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user