From 0575c9c69247d36b5f9ba1d4fba0e77e3426109e Mon Sep 17 00:00:00 2001 From: overflowerror Date: Sun, 9 Jan 2022 20:27:49 +0100 Subject: [PATCH] incorporated templates into demo --- demo.sh | 10 ++++++++-- templates/demo.html.templ | 13 +++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 templates/demo.html.templ diff --git a/demo.sh b/demo.sh index 27aab25..c247bb3 100755 --- a/demo.sh +++ b/demo.sh @@ -3,17 +3,23 @@ . base.sh . mysql.sh . credentials.sh +. shinden/engine.sh connect "$mysqlHost" "$mysqlUser" "$mysqlPassword" "$mysqlDB" route GET / index index() { + header "Content-Type" "text/html" endHeaders - echo "Users:" - echo "SELECT * FROM users" | query | getColumns 2 + title="Test" + users=($(echo "SELECT * FROM users" | query | getColumns 2)) + + template "templates/demo.html.templ" "" } + + route GET /debug debug debug() { endHeaders diff --git a/templates/demo.html.templ b/templates/demo.html.templ new file mode 100644 index 0000000..9f1ce19 --- /dev/null +++ b/templates/demo.html.templ @@ -0,0 +1,13 @@ + + + + {{ print "$title" }} + + + + +