2013-10-29 16:51:16 +01:00
|
|
|
unit MainWebModuleUnit;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
2018-08-05 20:31:33 +02:00
|
|
|
uses
|
|
|
|
System.SysUtils,
|
|
|
|
System.Classes,
|
|
|
|
Web.HTTPApp,
|
|
|
|
MVCFramework;
|
2013-10-29 16:51:16 +01:00
|
|
|
|
|
|
|
type
|
|
|
|
Twm = class(TWebModule)
|
|
|
|
procedure WebModuleCreate(Sender: TObject);
|
|
|
|
|
|
|
|
private
|
|
|
|
MVCEngine: TMVCEngine;
|
|
|
|
|
|
|
|
public
|
|
|
|
{ Public declarations }
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
WebModuleClass: TComponentClass = Twm;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
uses
|
2018-08-05 20:31:33 +02:00
|
|
|
WineCellarAppControllerU,
|
|
|
|
MVCFramework.Commons,
|
|
|
|
System.IOUtils;
|
2013-10-29 16:51:16 +01:00
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
procedure Twm.WebModuleCreate(Sender: TObject);
|
|
|
|
begin
|
|
|
|
MVCEngine := TMVCEngine.Create(self);
|
|
|
|
MVCEngine.AddController(TWineCellarApp);
|
2018-08-05 20:31:33 +02:00
|
|
|
MVCEngine.Config[TMVCConfigKey.DocumentRoot] := TPath.Combine(AppPath, '..\..\www');
|
|
|
|
MVCEngine.Config[TMVCConfigKey.IndexDocument] := 'index.html';
|
|
|
|
MVCEngine.Config[TMVCConfigKey.FallbackResource] := 'index.html';
|
2013-10-29 16:51:16 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|