chore: added model delete related to #2

This commit is contained in:
2023-09-21 15:38:02 +01:00
parent af62db6ad1
commit b8278bacf6
21 changed files with 1264 additions and 185 deletions

14
main.go
View File

@@ -1,8 +1,8 @@
package main
import (
"fmt"
"database/sql"
"fmt"
_ "github.com/lib/pq"
)
@@ -27,11 +27,21 @@ func main() {
defer db.Close()
fmt.Println("Starting server on :8000!")
//TODO check if file structure exists to save data
handle := NewHandler(db)
handle.GetHTML("/", AnswerTemplate("index.html", nil))
// 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.GetHTML("/", AnswerTemplate("index.html", nil, 0))
usersEndpints(db, handle)
handleModelsEndpoints(handle)
handle.Startup()
}