mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
30 lines
438 B
ObjectPascal
30 lines
438 B
ObjectPascal
unit MainControllerU;
|
|
|
|
interface
|
|
|
|
uses
|
|
MVCFramework, MVCFramework.Commons;
|
|
|
|
type
|
|
|
|
[MVCPath('/api')]
|
|
TMyController = class(TMVCController)
|
|
public
|
|
[MVCPath]
|
|
[MVCHTTPMethod([httpGET])]
|
|
procedure Index;
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
System.SysUtils, MVCFramework.Logger, System.StrUtils;
|
|
|
|
procedure TMyController.Index;
|
|
begin
|
|
//use Context property to access to the HTTP request and response
|
|
Render('X');
|
|
end;
|
|
|
|
end.
|