mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 15:55:54 +01:00
47 lines
903 B
ObjectPascal
47 lines
903 B
ObjectPascal
unit WebModuleUnit1;
|
|
|
|
interface
|
|
|
|
uses System.SysUtils,
|
|
System.Classes,
|
|
Web.HTTPApp,
|
|
MVCFramework,
|
|
MVCFramework.Commons;
|
|
|
|
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
|
|
MVC := TMVCEngine.Create(Self,
|
|
procedure(Config: TMVCConfig)
|
|
begin
|
|
Config[TMVCConfigKey.SessionTimeout] := '30';
|
|
Config[TMVCConfigKey.DefaultContentType] := 'text/plain';
|
|
end);
|
|
MVC
|
|
.AddController(TApp1MainController)
|
|
.AddMiddleware(TMVCSalutationMiddleware.Create)
|
|
.AddMiddleware(TMVCRedirectAndroidDeviceOnPlayStore.Create);
|
|
end;
|
|
|
|
end.
|