Add Visione backend foundation
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#include <drogon/drogon.h>
|
||||
|
||||
#include "plugins/RequestLogger.h"
|
||||
#include "repositories/MigrationRunner.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
setvbuf(stdout, nullptr, _IONBF, 0);
|
||||
(void)RequestLogger::classTypeName();
|
||||
|
||||
const auto configPath = argc > 1 ? argv[1] : "config.json";
|
||||
Json::Value requestLoggerConfig;
|
||||
requestLoggerConfig["include_query"] = true;
|
||||
|
||||
drogon::app().loadConfigFile(configPath);
|
||||
drogon::app().addPlugin("RequestLogger", {}, requestLoggerConfig);
|
||||
|
||||
const auto migrationsPath = drogon::app()
|
||||
.getCustomConfig()
|
||||
.get("migrations_path", "migrations")
|
||||
.asString();
|
||||
visione::repositories::MigrationRunner::run(migrationsPath);
|
||||
|
||||
drogon::app().run();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user