shochu/demo.sh

32 lines
413 B
Bash
Raw Normal View History

2022-01-09 18:38:22 +00:00
#!/bin/bash
. base.sh
2022-01-09 19:19:58 +00:00
. mysql.sh
. credentials.sh
2022-01-09 19:27:49 +00:00
. shinden/engine.sh
2022-01-09 19:19:58 +00:00
connect "$mysqlHost" "$mysqlUser" "$mysqlPassword" "$mysqlDB"
2022-01-09 18:38:22 +00:00
route GET / index
index() {
2022-01-09 19:27:49 +00:00
header "Content-Type" "text/html"
2022-01-09 18:38:22 +00:00
endHeaders
2022-01-09 19:27:49 +00:00
title="Test"
users=($(echo "SELECT * FROM users" | query | getColumns 2))
template "templates/demo.html.templ" ""
2022-01-09 18:38:22 +00:00
}
2022-01-09 19:27:49 +00:00
2022-01-09 18:38:22 +00:00
route GET /debug debug
debug() {
endHeaders
echo "$pathInfo"
set
}
router