library mod_dmvc; uses System.Threading, Winapi.ActiveX, System.Win.ComObj, Web.WebBroker, Web.ApacheApp, Web.HTTPD24Impl, MVCFramework.Logger, MVCFramework.DotEnv, MVCFramework.Commons, Web.HTTPDMethods, Winapi.Windows, System.Classes, MainDataModuleUnit in '..\WineCellarSample\winecellarserver\MainDataModuleUnit.pas' {WineCellarDataModule: TDataModule}, MainWebModuleUnit in '..\WineCellarSample\winecellarserver\MainWebModuleUnit.pas' {wm: TWebModule}, WineCellarAppControllerU in '..\WineCellarSample\winecellarserver\WineCellarAppControllerU.pas', WinesBO in '..\WineCellarSample\winecellarserver\WinesBO.pas'; {$R *.res} // httpd.conf entries: // (* LoadModule dmvc_module modules/mod_dmvc.dll SetHandler mod_dmvc-handler *) // // These entries assume that the output directory for this project is the apache/modules directory. // // httpd.conf entries should be different if the project is changed in these ways: // 1. The TApacheModuleData variable name is changed // 2. The project is renamed. // 3. The output directory is not the apache/modules directory // // Declare exported variable so that Apache can access this module. var GModuleData: TApacheModuleData; exports GModuleData name 'dmvc_module'; { Navigate to http://localhost/winecellar/ } procedure RegisterLogger(const p: Pointer); begin dotEnv( NewDotEnv .WithStrategy(TMVCDotEnvPriority.FileThenEnv) //if available, by default, loads default environment (.env) .UseProfile('test') //if available loads the test environment (.env.test) .UseProfile('prod') //if available loads the prod environment (.env.prod) .UseLogger(procedure(LogItem: String) begin LogW('dotEnv: ' + LogItem); end) .Build() //uses the executable folder to look for .env* files ); end; begin UseDotEnvDelegate( function : IMVCDotEnv begin Result := NewDotEnv .WithStrategy(TMVCDotEnvPriority.FileThenEnv) //if available, by default, loads default environment (.env) .UseProfile('test') //if available loads the test environment (.env.test) .UseProfile('prod') //if available loads the prod environment (.env.prod) .UseLogger(procedure(LogItem: String) begin LogW('dotEnv: ' + LogItem); end) .Build(); //uses the executable folder to look for .env* files end); CoInitFlags := COINIT_MULTITHREADED; Web.ApacheApp.InitApplication(@GModuleData); Application.Initialize; Application.WebModuleClass := WebModuleClass; Application.Run; end.