delphimvcframework/samples/renders/renders.dpr

48 lines
1.1 KiB
ObjectPascal
Raw Normal View History

2013-11-10 01:03:53 +01:00
program renders;
2013-11-10 01:03:53 +01:00
{$APPTYPE CONSOLE}
uses
System.SysUtils,
IdHTTPWebBrokerBridge,
MVCFramework.Commons,
2013-11-10 01:03:53 +01:00
Web.WebReq,
Web.WebBroker,
WebModuleU in 'WebModuleU.pas' {WebModule1: TWebModule} ,
2013-11-10 01:03:53 +01:00
RenderSampleControllerU in 'RenderSampleControllerU.pas',
2016-11-27 23:17:20 +01:00
BusinessObjectsU in '..\commons\BusinessObjectsU.pas',
MyDataModuleU in 'MyDataModuleU.pas' {MyDataModule: TDataModule};
2013-11-10 01:03:53 +01:00
{$R *.res}
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;
Writeln('DMVCFRAMEWORK VERSION: ', DMVCFRAMEWORK_VERSION);
Writeln('Press RETURN to stop the server');
ReadLn;
Writeln('Stopping...');
2013-11-10 01:03:53 +01:00
finally
LServer.Free;
end;
end;
begin
2016-11-27 23:17:20 +01:00
ReportMemoryLeaksOnShutdown := True;
2013-11-10 01:03:53 +01:00
try
if WebRequestHandler <> nil then
WebRequestHandler.WebModuleClass := WebModuleClass;
RunServer(8080);
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end
end.