delphimvcframework/samples/rest_logs_collector/RESTLogsCollector.dpr
Daniele Teti 88cb06e717 Squashed 'lib/loggerpro/' changes from 49891138..d490578b
d490578b Update README.md
0dedf956 Added ILogItemRenders

git-subtree-dir: lib/loggerpro
git-subtree-split: d490578b87872f7995c230f48e328e576d0e2ffe
2024-01-23 17:20:36 +01:00

59 lines
1.5 KiB
ObjectPascal

program RESTLogsCollector;
{$APPTYPE CONSOLE}
uses
System.SysUtils,
MVCFramework.Logger,
MVCFramework.Signal,
MVCFramework.Commons,
MVCFramework.REPLCommandsHandlerU,
Web.ReqMulti,
Web.WebReq,
Web.WebBroker,
IdHTTPWebBrokerBridge,
LogsCollectorControllerU in 'LogsCollectorControllerU.pas',
MainWMU in 'MainWMU.pas' {MyWebModule: TWebModule},
LoggerProConfig in 'LoggerProConfig.pas';
{$R *.res}
procedure RunServer(APort: Integer);
var
lServer: TIdHTTPWebBrokerBridge;
begin
Writeln('** LoggerPro RESTLogsCollector [DMVCFramework Server ** build ' + DMVCFRAMEWORK_VERSION + ']');
lServer := TIdHTTPWebBrokerBridge.Create(nil);
try
lServer.DefaultPort := APort;
{ more info about MaxConnections
http://www.indyproject.org/docsite/html/frames.html?frmname=topic&frmfile=TIdCustomTCPServer_MaxConnections.html }
lServer.MaxConnections := 0;
{ more info about ListenQueue
http://www.indyproject.org/docsite/html/frames.html?frmname=topic&frmfile=TIdCustomTCPServer_ListenQueue.html }
lServer.ListenQueue := 200;
lServer.Active := True;
Write('CTRL + C to EXIT');
WaitForTerminationSignal;
finally
lServer.Free;
end;
end;
begin
ReportMemoryLeaksOnShutdown := True;
IsMultiThread := True;
try
if WebRequestHandler <> nil then
WebRequestHandler.WebModuleClass := WebModuleClass;
WebRequestHandlerProc.MaxConnections := 1024;
RunServer(8080);
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.