|
|
|
@ -45,6 +45,22 @@ int main()
|
|
|
|
return entries;
|
|
|
|
return entries;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CROW_ROUTE(app, "/mins-left-to-practice-today")([](){
|
|
|
|
|
|
|
|
crow::json::wvalue entries;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ResultSet *res = stmt->executeQuery("SELECT * FROM mins_left_to_practice_today;");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
while (res->next()) {
|
|
|
|
|
|
|
|
double time_left = res->getDouble("time_left");
|
|
|
|
|
|
|
|
entries[i] = {{"time_left", time_left}};
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
delete res;
|
|
|
|
|
|
|
|
return entries;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
app.port(18080).run();
|
|
|
|
app.port(18080).run();
|
|
|
|
|
|
|
|
|
|
|
|
atexit(exiting);
|
|
|
|
atexit(exiting);
|
|
|
|
|