2013-10-30 01:09:09 +01:00
|
|
|
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}
|
|
|
|
|
|
|
|
|
2013-11-08 23:10:25 +01:00
|
|
|
uses
|
2014-03-31 11:25:16 +02:00
|
|
|
TestServerControllerU, TestServerControllerExceptionU, SpeedMiddlewareU;
|
2013-10-30 01:09:09 +01:00
|
|
|
|
|
|
|
procedure Twm.WebModuleCreate(Sender: TObject);
|
|
|
|
begin
|
|
|
|
MVCEngine := TMVCEngine.Create(self);
|
2013-12-05 16:19:01 +01:00
|
|
|
MVCEngine
|
|
|
|
.AddController(TTestServerController)
|
|
|
|
.AddController(TTestServerControllerExceptionAfterCreate)
|
2014-03-31 11:25:16 +02:00
|
|
|
.AddController(TTestServerControllerExceptionBeforeDestroy)
|
|
|
|
.AddMiddleware(TMVCSpeedMiddleware.Create);
|
2014-03-10 17:39:29 +01:00
|
|
|
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';
|
2013-10-30 01:09:09 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|