rcpp_framework/modules/message_page/message_page.cpp
2020-12-01 17:01:59 +01:00

24 lines
439 B
C++

#include "message_page.h"
void MessagePage::index(Request *request) {
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();
}
MessagePage::MessagePage() {
messages.push_back("t message 1");
messages.push_back("t message 2");
}
MessagePage::~MessagePage() {
}