2022-01-09 18:38:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-01-09 20:26:46 +00:00
|
|
|
. utils.sh
|
|
|
|
. uri.sh
|
|
|
|
. router.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
|