mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-16 08:15:53 +01:00
44 lines
1.0 KiB
ObjectPascal
44 lines
1.0 KiB
ObjectPascal
unit WebModuleUnit;
|
|
|
|
interface
|
|
|
|
uses System.SysUtils,
|
|
System.Classes,
|
|
Web.HTTPApp,
|
|
MVCFramework;
|
|
|
|
type
|
|
Twm = class(TWebModule)
|
|
procedure WebModuleCreate(Sender: TObject);
|
|
private
|
|
MVCEngine: TMVCEngine;
|
|
end;
|
|
|
|
var
|
|
WebModuleClass: TComponentClass = Twm;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
uses
|
|
TestServerControllerU, TestServerControllerExceptionU, SpeedMiddlewareU;
|
|
|
|
procedure Twm.WebModuleCreate(Sender: TObject);
|
|
begin
|
|
MVCEngine := TMVCEngine.Create(self);
|
|
MVCEngine
|
|
.AddController(TTestServerController)
|
|
.AddController(TTestServerControllerExceptionAfterCreate)
|
|
.AddController(TTestServerControllerExceptionBeforeDestroy)
|
|
.AddMiddleware(TMVCSpeedMiddleware.Create);
|
|
MVCEngine.Config[TMVCConfigKey.StompServer] := 'localhost';
|
|
MVCEngine.Config[TMVCConfigKey.StompServerPort] := '61613';
|
|
MVCEngine.Config[TMVCConfigKey.StompUserName] := 'guest';
|
|
MVCEngine.Config[TMVCConfigKey.StompPassword] := 'guest';
|
|
MVCEngine.Config[TMVCConfigKey.Messaging] := 'false';
|
|
end;
|
|
|
|
end.
|