core-legacy/main.cc
Tobias Reisinger 2d24339421 add: helpers
unstable: discovering
2019-07-15 00:39:37 +02:00

34 lines
713 B
C++

#include <drogon/drogon.h>
#include <sqlite3.h>
#include <models/device_dbo.h>
#include "globals.h"
int main() {
int rc;
/* Open database */
rc = sqlite3_open("test.db", &globals::db);
if( rc ) {
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(globals::db));
return 1;
}
device_dbo test;
strcpy(test.id, "meine-tolle_id-123");
strcpy(test.name, "test_device latest name");
strcpy(test.ip, "192.168.1.68");
test.active = true;
//test.save();
//Load config file
drogon::app().loadConfigFile("../config.json");
//Run HTTP framework,the method will block in the internal event loop
drogon::app().run();
return 0;
}