#include "dashboardcontroller.h"
#include "serialization/result.h"

ApiMock::ResponseData ApiMock::DashboardController::get(RequestData request) {
	auto result = Html("<h1>Hello, world</h1>\n<p>This is an HTML result</p>");
	return createResponse(HTTP_OK, &result);
}
#include "dashboardcontroller.h"
#include "serialization/result.h"
#include <fstream>

ApiMock::ResponseData ApiMock::DashboardController::get(RequestData request) {
	// TODO: This is temporary, just to try the concept out. But really: files shouldn't be loaded like this:
	std::ifstream dashboard("www/dashboard.html");
	std::string temp;
	std::string body;

	while (std::getline(dashboard, temp))
		body += temp;

	auto result = Html(body);
	return createResponse(HTTP_OK, &result);
}
Read the dashboard file and return the content
Read the dashboard file and return the content

For now. This is an ugly solution that I'll have to do more
with. But it'll do for now.
