mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-16 16:25:54 +01:00
45 lines
781 B
ObjectPascal
45 lines
781 B
ObjectPascal
|
unit WebModuleUnit1;
|
||
|
|
||
|
interface
|
||
|
|
||
|
uses
|
||
|
System.SysUtils,
|
||
|
System.Classes,
|
||
|
Web.HTTPApp,
|
||
|
MVCFramework;
|
||
|
|
||
|
type
|
||
|
TWebModule1 = class(TWebModule)
|
||
|
procedure WebModuleCreate(Sender: TObject);
|
||
|
|
||
|
private
|
||
|
MVC: TMVCEngine;
|
||
|
|
||
|
public
|
||
|
{ Public declarations }
|
||
|
end;
|
||
|
|
||
|
var
|
||
|
WebModuleClass: TComponentClass = TWebModule1;
|
||
|
|
||
|
implementation
|
||
|
|
||
|
{$R *.dfm}
|
||
|
|
||
|
|
||
|
uses AppControllerU, MVCFramework.Commons;
|
||
|
|
||
|
procedure TWebModule1.WebModuleCreate(Sender: TObject);
|
||
|
begin
|
||
|
MVC := TMVCEngine.Create(Self,
|
||
|
procedure(Config: TMVCConfig)
|
||
|
begin
|
||
|
Config[TMVCConfigKey.SessionTimeout] := '10'; // 10minutes
|
||
|
Config[TMVCConfigKey.DefaultContentType] := 'text/plain';
|
||
|
Config[TMVCConfigKey.SessionType] := 'file';
|
||
|
end);
|
||
|
MVC.AddController(TApp1MainController);
|
||
|
end;
|
||
|
|
||
|
end.
|