delphimvcframework/samples/winecellarserver/MainWebModuleUnit.pas
Daniele Teti 00d5a9699a - Config[TMVCConfigKey.FallbackResource] is served only if request path is empty or /.
- Now the JSON-RPC executor provides methods to handle HTTP headers for JSON-RPC requests and notifications.
- FIX for [issue #141](https://github.com/danieleteti/delphimvcframework/issues/141)
- `TDataSetHolder` is a new render that is able to render a dataset with a set of custom metadata (eg `count`,`page` etc). Check [issue #137](https://github.com/danieleteti/delphimvcframework/issues/137)
2018-08-05 20:31:56 +02:00

44 lines
834 B
ObjectPascal

unit MainWebModuleUnit;
interface
uses
System.SysUtils,
System.Classes,
Web.HTTPApp,
MVCFramework;
type
Twm = class(TWebModule)
procedure WebModuleCreate(Sender: TObject);
private
MVCEngine: TMVCEngine;
public
{ Public declarations }
end;
var
WebModuleClass: TComponentClass = Twm;
implementation
uses
WineCellarAppControllerU,
MVCFramework.Commons,
System.IOUtils;
{$R *.dfm}
procedure Twm.WebModuleCreate(Sender: TObject);
begin
MVCEngine := TMVCEngine.Create(self);
MVCEngine.AddController(TWineCellarApp);
MVCEngine.Config[TMVCConfigKey.DocumentRoot] := TPath.Combine(AppPath, '..\..\www');
MVCEngine.Config[TMVCConfigKey.IndexDocument] := 'index.html';
MVCEngine.Config[TMVCConfigKey.FallbackResource] := 'index.html';
end;
end.