mirror of https://github.com/nymea/nymea.git
close #274
parent
7ee67da613
commit
97e892b87e
|
|
@ -5,15 +5,12 @@
|
|||
The guh server provides two different API's:
|
||||
\list
|
||||
\li \l{JSON-RPC API}{JSON-RPC}
|
||||
\li \l{https://github.com/guh/guh/wiki/REST-Api-documentation}{REST}
|
||||
\li \l{https://github.com/guh/guh/wiki/REST-API}{REST}
|
||||
\endlist
|
||||
|
||||
|
||||
The \l{https://github.com/guh/guh/wiki/REST-Api-documentation}{REST API} is accessable on the \l{guhserver::WebServer}{WebServer}. The JSON-RPC API can be accessed from the \l {guhserver::TcpServer}{TcpServer} and the \l {guhserver::WebSocketServer}{WebSocketServer} interface. The command line interface \b {\tt guh-cli} communicates with the \l {guhserver::TcpServer}{TcpServer} and \l {JSON-RPC API}. The \b {\tt guh-webinterface} uses the \l{guhserver::WebServer}{WebServer} with the \l{https://github.com/guh/guh/wiki/REST-Api-documentation}{REST-API} and catches notifications from the \l {guhserver::WebSocketServer}{WebSocketServer}.
|
||||
|
||||
\image api-overview.png
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -31,10 +31,16 @@
|
|||
\sa QtService
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include "unistd.h"
|
||||
#include "stdio.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
#include "guhservice.h"
|
||||
#include "guhsettings.h"
|
||||
#include "loggingcategories.h"
|
||||
|
||||
|
||||
namespace guhserver {
|
||||
|
||||
/*! Constructs the forked guhd application with the given argument count \a argc and argument vector \a argv. */
|
||||
|
|
@ -59,6 +65,11 @@ GuhService::~GuhService()
|
|||
/*! Starts the forked guhd application. */
|
||||
void GuhService::start()
|
||||
{
|
||||
// check if config directory for logfile exists
|
||||
if (!QDir().mkpath(GuhSettings::settingsPath())) {
|
||||
fprintf(stdout, "Could not create guh settings directory %s", qPrintable(GuhSettings::settingsPath()));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
qCDebug(dcApplication) << "=====================================";
|
||||
qCDebug(dcApplication) << "guhd" << GUH_VERSION_STRING << "started as daemon.";
|
||||
qCDebug(dcApplication) << "=====================================";
|
||||
|
|
|
|||
|
|
@ -191,7 +191,6 @@ int main(int argc, char *argv[])
|
|||
fprintf(stdout, "Could not create guh settings directory %s", qPrintable(GuhSettings::settingsPath()));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
qCDebug(dcApplication) << "=====================================";
|
||||
qCDebug(dcApplication) << "guhd" << GUH_VERSION_STRING << "started with user ID" << userId;
|
||||
qCDebug(dcApplication) << "=====================================";
|
||||
|
|
|
|||
Loading…
Reference in New Issue