2013-11-09 10:32:54 +01:00
|
|
|
program routingsample;
|
2017-04-20 23:48:50 +02:00
|
|
|
|
2013-11-09 10:32:54 +01:00
|
|
|
{$APPTYPE CONSOLE}
|
|
|
|
|
2014-03-06 14:20:57 +01:00
|
|
|
|
2013-11-09 10:32:54 +01:00
|
|
|
uses
|
|
|
|
System.SysUtils,
|
|
|
|
IdHTTPWebBrokerBridge,
|
|
|
|
Web.WebReq,
|
|
|
|
Web.WebBroker,
|
2014-03-06 14:20:57 +01:00
|
|
|
WebModuleU in 'WebModuleU.pas' {WebModule1: TWebModule} ,
|
2013-11-10 01:03:53 +01:00
|
|
|
RoutingSampleControllerU in 'RoutingSampleControllerU.pas',
|
|
|
|
BusinessObjectsU in 'BusinessObjectsU.pas';
|
2013-11-09 10:32:54 +01:00
|
|
|
|
|
|
|
{$R *.res}
|
|
|
|
|
2014-03-06 14:20:57 +01:00
|
|
|
|
2013-11-09 10:32:54 +01:00
|
|
|
procedure RunServer(APort: Integer);
|
|
|
|
var
|
|
|
|
LServer: TIdHTTPWebBrokerBridge;
|
|
|
|
begin
|
|
|
|
Writeln(Format('Starting HTTP Server or port %d', [APort]));
|
|
|
|
LServer := TIdHTTPWebBrokerBridge.Create(nil);
|
|
|
|
try
|
|
|
|
LServer.DefaultPort := APort;
|
|
|
|
LServer.Active := True;
|
2014-03-06 14:20:57 +01:00
|
|
|
LServer.ServerSoftware := 'DMVCFramework';
|
2017-04-20 23:48:50 +02:00
|
|
|
Writeln('Press RETURN to stop the server');
|
|
|
|
ReadLn;
|
2013-11-09 10:32:54 +01:00
|
|
|
finally
|
|
|
|
LServer.Free;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
begin
|
|
|
|
try
|
2014-03-06 14:20:57 +01:00
|
|
|
if WebRequestHandler <> nil then
|
|
|
|
WebRequestHandler.WebModuleClass := WebModuleClass;
|
2013-11-09 10:32:54 +01:00
|
|
|
RunServer(8080);
|
|
|
|
except
|
|
|
|
on E: Exception do
|
|
|
|
Writeln(E.ClassName, ': ', E.Message);
|
|
|
|
end
|
2014-03-06 14:20:57 +01:00
|
|
|
|
2013-11-09 10:32:54 +01:00
|
|
|
end.
|