fpc/packages/fpindexer/examples/httpsearch.pas
michael ed4b94706b * HTML search database example
git-svn-id: trunk@39415 -
2018-07-08 19:46:15 +00:00

35 lines
667 B
ObjectPascal

program httpsearch;
// Undefine this to make a standalone HTTP server.
// The standalone HTTP server listens on port 3010,
// Change DefaultPort below to change this port.
{$define usecgi}
uses
{$ifdef usecgi}
fpcgi,
{$else}
fphttpapp,
{$endif}
httpdefs, httproute, httpsearcher;
{$ifndef usecgi}
Const
DefaultPort = 3010;
{$ENDIF}
Var
aSearch : THTTPSearcher;
begin
aSearch:=THTTPSearcher.Create(Application);
HTTPRouter.RegisterRoute('/search',@aSearch.HTMLSearch,true);
HTTPRouter.RegisterRoute('/list',@aSearch.WordList,False);
{$ifndef usecgi}
Application.Port:=DefaultPort;
{$endif}
Application.Initialize;
Application.Run;
end.