chore: added model delete related to #2
This commit is contained in:
14
main.go
14
main.go
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user