2014-04-01 00:02:31 +02:00
|
|
|
unit WebModuleUnit1;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses System.SysUtils,
|
|
|
|
System.Classes,
|
|
|
|
Web.HTTPApp,
|
2017-06-22 16:18:58 +02:00
|
|
|
MVCFramework;
|
2014-04-01 00:02:31 +02:00
|
|
|
|
|
|
|
type
|
|
|
|
TWebModule1 = class(TWebModule)
|
|
|
|
procedure WebModuleCreate(Sender: TObject);
|
|
|
|
|
|
|
|
private
|
|
|
|
MVC: TMVCEngine;
|
|
|
|
|
|
|
|
public
|
|
|
|
{ Public declarations }
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
WebModuleClass: TComponentClass = TWebModule1;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
2017-06-22 16:18:58 +02:00
|
|
|
uses AppControllerU, MVCFramework.Commons;
|
2014-04-01 00:02:31 +02:00
|
|
|
|
|
|
|
procedure TWebModule1.WebModuleCreate(Sender: TObject);
|
|
|
|
begin
|
2017-06-22 16:18:58 +02:00
|
|
|
MVC := TMVCEngine.Create(Self,
|
|
|
|
procedure(Config: TMVCConfig)
|
|
|
|
begin
|
|
|
|
Config[TMVCConfigKey.SessionTimeout] := '10'; // 10minutes
|
2022-10-26 19:31:54 +02:00
|
|
|
Config[TMVCConfigKey.DefaultContentType] := TMVCMediaType.TEXT_HTML;
|
2017-06-22 16:18:58 +02:00
|
|
|
end);
|
2014-04-01 00:02:31 +02:00
|
|
|
MVC.AddController(TApp1MainController);
|
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|