mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-28 08:16:59 -05:00
b05ee805e4
- added better live reload. It uses the Retroshare built in server. Grunt is not required anymore. - removed unused buttons - started ChatHandler git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8185 b45a01b8-16f6-495d-af2f-9b41ad6348cc
26 lines
696 B
C++
26 lines
696 B
C++
#include "LivereloadHandler.h"
|
|
|
|
namespace resource_api
|
|
{
|
|
LivereloadHandler::LivereloadHandler(StateTokenServer *sts):
|
|
mStateTokenServer(sts), mStateToken(sts->getNewToken())
|
|
{
|
|
addResourceHandler("*", this, &LivereloadHandler::handleWildcard);
|
|
addResourceHandler("trigger", this, &LivereloadHandler::handleTrigger);
|
|
}
|
|
|
|
void LivereloadHandler::handleWildcard(Request &/*req*/, Response &resp)
|
|
{
|
|
resp.mStateToken = mStateToken;
|
|
resp.setOk();
|
|
}
|
|
|
|
void LivereloadHandler::handleTrigger(Request &/*req*/, Response &resp)
|
|
{
|
|
mStateTokenServer->replaceToken(mStateToken);
|
|
resp.mStateToken = mStateToken;
|
|
resp.setOk();
|
|
}
|
|
|
|
} // namespace resource_api
|