diff options
| author | 2017-01-14 22:39:04 +0100 | |
|---|---|---|
| committer | 2017-01-14 22:39:04 +0100 | |
| commit | 7a5bc0677e5e7f6d72fb4432672bc309f7ff61da (patch) | |
| tree | 4b6d356b4a82d7ca704f4850db4a226891b52509 /webserver | |
| parent | 9189e58f97f9f5d04e1a8063eb54c927278b9876 (diff) | |
| download | OneRoll-7a5bc0677e5e7f6d72fb4432672bc309f7ff61da.tar.gz OneRoll-7a5bc0677e5e7f6d72fb4432672bc309f7ff61da.zip | |
-fix help command.
Diffstat (limited to 'webserver')
| -rw-r--r-- | webserver/diceserver.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/webserver/diceserver.cpp b/webserver/diceserver.cpp index 7332f81..c1e1ca0 100644 --- a/webserver/diceserver.cpp +++ b/webserver/diceserver.cpp @@ -9,6 +9,8 @@ DiceServer::DiceServer(int port) : QObject(),m_diceParser(new DiceParser()) { + + m_diceParser->setPathToHelp("<span><a href=\"https://github.com/Rolisteam/DiceParser/blob/master/HelpMe.md\">Documentation</a>"); // using namespace ; m_server = new qhttp::server::QHttpServer(this); m_server->listen( // listening on 0.0.0.0:8080 @@ -36,15 +38,21 @@ DiceServer::DiceServer(int port) { qDebug() << QUrl::fromPercentEncoding(m_hashArgs["cmd"].toLocal8Bit()); QString result = startDiceParsing(QUrl::fromPercentEncoding(m_hashArgs["cmd"].toLocal8Bit())); + qDebug() << result; res->setStatusCode(qhttp::ESTATUS_OK); + res->addHeader("Access-Control-Allow-Origin", "*"); + res->addHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS"); + res->addHeader("Access-Control-Allow-Headers", "x-requested-with"); + + QString html("<!doctype html>\n" "<html>\n" "<head>\n" - "</head>\n" " <meta charset=\"utf-8\">\n" " <title>Rolisteam Dice System Webservice</title>\n" " <style>.dice {color:#FF0000;font-weight: bold;}</style>" + "</head>\n" "<body>\n" "%1\n" "</body>\n" |