testsuite.pp 641 B

123456789101112131415161718192021222324252627282930313233343536
  1. {
  2. Main entry for testsuite CGI/HTTP program.
  3. }
  4. {$mode objfpc}
  5. {$h+}
  6. { $define httpserver}
  7. program testsuite;
  8. uses
  9. sysutils, httproute, fpweb, tshttp, tsconsts, tshtml, tsutils,
  10. {$ifdef httpserver}
  11. fphttpapp
  12. {$else}
  13. fpcgi
  14. {$endif}
  15. ;
  16. begin
  17. if paramstr(0)<>'' then
  18. TestsuiteCGIURL:=TestsuiteURLPrefix+'cgi-bin/'+extractfilename(paramstr(0))
  19. else
  20. TestsuiteCGIURL:=TestsuiteURLPrefix+'cgi-bin/'+TestsuiteBin;
  21. HTTPRouter.RegisterRoute('*',rmAll,@HandleTestSuiteRequest,True);
  22. Application.Initialize;
  23. {$ifdef httpserver}
  24. Application.Port:=9090;
  25. {$else}
  26. IsCGI:=True;
  27. {$endif}
  28. Application.Run;
  29. end.