2014-04-01 02:12:34 +02:00
|
|
|
unit WebModuleUnit1;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses System.SysUtils,
|
|
|
|
System.Classes,
|
|
|
|
Web.HTTPApp,
|
2017-03-30 21:22:54 +02:00
|
|
|
MVCFramework,
|
|
|
|
MVCFramework.Commons;
|
2014-04-01 02:12:34 +02:00
|
|
|
|
|
|
|
type
|
|
|
|
TWebModule1 = class(TWebModule)
|
|
|
|
procedure WebModuleCreate(Sender: TObject);
|
|
|
|
|
|
|
|
private
|
|
|
|
MVC: TMVCEngine;
|
|
|
|
|
|
|
|
public
|
|
|
|
{ Public declarations }
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
WebModuleClass: TComponentClass = TWebModule1;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
uses AppControllerU, MiddlewareSample1;
|
|
|
|
|
|
|
|
procedure TWebModule1.WebModuleCreate(Sender: TObject);
|
|
|
|
begin
|
2020-05-11 23:39:43 +02:00
|
|
|
MVC := TMVCEngine.Create(Self,
|
|
|
|
procedure(Config: TMVCConfig)
|
|
|
|
begin
|
|
|
|
Config[TMVCConfigKey.SessionTimeout] := '30';
|
|
|
|
Config[TMVCConfigKey.DefaultContentType] := 'text/plain';
|
|
|
|
end);
|
2014-04-01 02:12:34 +02:00
|
|
|
MVC
|
|
|
|
.AddController(TApp1MainController)
|
|
|
|
.AddMiddleware(TMVCSalutationMiddleware.Create)
|
|
|
|
.AddMiddleware(TMVCRedirectAndroidDeviceOnPlayStore.Create);
|
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|