mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-10 03:54:54 -06:00
.tutorial: Skylark01
git-svn-id: svn://ultimatepp.org/upp/trunk@5129 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
67e3756879
commit
bde8ae10dd
1 changed files with 19 additions and 4 deletions
|
|
@ -2,29 +2,44 @@
|
|||
|
||||
using namespace Upp;
|
||||
|
||||
SKYLARK(HomePage, "**")
|
||||
SKYLARK(HomePage, "")
|
||||
{
|
||||
http << "<html><body>Hello world!</body></html>";
|
||||
}
|
||||
|
||||
SKYLARK(Param, "*/param")
|
||||
{
|
||||
http << "<html><body>Param entered: " << http[0] << "</html></body>";
|
||||
http << "<html><body>Parameter: " << http[0] << "</html></body>";
|
||||
}
|
||||
|
||||
SKYLARK(Params, "params/**")
|
||||
{
|
||||
http << "<html><body>Parameters: ";
|
||||
for(int i = 0; i < http.GetParamCount(); i++)
|
||||
http << http[i] << " ";
|
||||
http << "</html></body>";
|
||||
}
|
||||
|
||||
SKYLARK(CatchAll, "**")
|
||||
{
|
||||
http.Redirect(HomePage);
|
||||
}
|
||||
|
||||
struct MyApp : SkylarkApp {
|
||||
MyApp() {
|
||||
root = "myapp";
|
||||
#ifdef _DEBUG
|
||||
prefork = 0;
|
||||
use_caching = false;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#ifdef _DEBUG
|
||||
StdLogSetup(LOG_FILE|LOG_COUT);
|
||||
skylark_log = true;
|
||||
Ini::skylark_log = true;
|
||||
#endif
|
||||
|
||||
MyApp().Run();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue