2020-12-01 17:01:59 +01:00
|
|
|
#include "message_page.h"
|
|
|
|
|
2020-12-01 18:29:41 +01:00
|
|
|
#include "core/database.h"
|
|
|
|
|
2020-12-01 17:01:59 +01:00
|
|
|
void MessagePage::index(Request *request) {
|
2020-12-01 18:29:41 +01:00
|
|
|
db->query("show databases;");
|
|
|
|
db->query("show tables;");
|
|
|
|
db->query("SELECT * FROM tutorials_tbl;");
|
2020-12-01 17:01:59 +01:00
|
|
|
|
|
|
|
std::string r = "<html><body>";
|
|
|
|
|
|
|
|
for (uint32_t i = 0; i < messages.size(); ++i) {
|
|
|
|
r += "<p>" + messages[i] + "</p><br>";
|
|
|
|
}
|
|
|
|
|
|
|
|
r += "</html></body>";
|
|
|
|
|
|
|
|
request->response->setBody(r);
|
|
|
|
request->send();
|
|
|
|
}
|
|
|
|
|
2020-12-01 18:29:41 +01:00
|
|
|
MessagePage::MessagePage() : Object() {
|
|
|
|
messages.push_back("T message 1");
|
|
|
|
messages.push_back("T message 2");
|
2020-12-01 17:01:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
MessagePage::~MessagePage() {
|
|
|
|
|
|
|
|
}
|