ultimatepp/bazaar/SkylarkGuiExample/Handlers.icpp
zbych bff0f52f4e Simple application combining web server and gui
git-svn-id: svn://ultimatepp.org/upp/trunk@9909 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2016-06-07 20:03:42 +00:00

28 lines
551 B
Text

#include "WebInterface.h"
using namespace Upp;
MTObj<String> WebInterface::SharedVariable;
Callback1<String> WebInterface::MessageFromWeb;
SKYLARK(HomePage, "")
{
http
("SharedVariable", WebInterface::SharedVariable.Get())
("Time", FormatTime(GetSysTime(), "YYYY/MM/DD hh:mm:ss"))
.RenderResult("SkylarkGuiExample/index");
}
SKYLARK(PostSomeData, "PostSomeData:POST")
{
WebInterface::MessageFromWeb(http["SharedVariable"]);
http.Redirect(HomePage);
}
SKYLARK(CatchAll, "**")
{
http.Redirect(HomePage);
}