mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
tutorial: Skylark01
git-svn-id: svn://ultimatepp.org/upp/trunk@5127 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
344e417c7b
commit
0843ecdfd6
3 changed files with 35 additions and 11 deletions
|
|
@ -1,8 +1,31 @@
|
||||||
#include <Core/Core.h>
|
#include <Skylark/Skylark.h>
|
||||||
|
|
||||||
using namespace Upp;
|
using namespace Upp;
|
||||||
|
|
||||||
|
SKYLARK(HomePage, "**")
|
||||||
|
{
|
||||||
|
http << "<html><body>Hello world!</body></html>";
|
||||||
|
}
|
||||||
|
|
||||||
|
SKYLARK(Param, "*/param")
|
||||||
|
{
|
||||||
|
http << "<html><body>Param entered: " << http[0] << "</html></body>";
|
||||||
|
}
|
||||||
|
|
||||||
|
struct MyApp : SkylarkApp {
|
||||||
|
MyApp() {
|
||||||
|
root = "myapp";
|
||||||
|
prefork = 0;
|
||||||
|
use_caching = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
CONSOLE_APP_MAIN
|
CONSOLE_APP_MAIN
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
StdLogSetup(LOG_FILE|LOG_COUT);
|
||||||
|
skylark_log = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
MyApp().Run();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
uses
|
uses
|
||||||
Core;
|
Core,
|
||||||
|
Skylark;
|
||||||
|
|
||||||
file
|
file
|
||||||
Skylark01.cpp;
|
Skylark01.cpp;
|
||||||
|
|
||||||
mainconfig
|
mainconfig
|
||||||
"" = "SSE2";
|
"" = "SSE2 MT";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef _Skylark01_icpp_init_stub
|
#ifndef _Skylark01_icpp_init_stub
|
||||||
#define _Skylark01_icpp_init_stub
|
#define _Skylark01_icpp_init_stub
|
||||||
#include "Core/init"
|
#include "Core/init"
|
||||||
#include "plugin/sqlite3/init"
|
#include "Skylark/init"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue