Created
January 10, 2023 05:52
-
-
Save delphiapp/9564040c3d229b2c19a740858068f326 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program pHTTPServer; | |
{$APPTYPE CONSOLE} | |
{$DEFINE VER2}//switch to another version | |
uses | |
forms, SysUtils, Windows | |
{$IFDEF VER2} | |
,mormot.rest.http.server | |
{$ELSE} | |
,mORMotHttpServer | |
{$ENDIF} | |
; | |
var fHTTPServer : TSQLHttpServer; | |
const PORT='9999'; | |
begin | |
try | |
try | |
fHTTPServer:=TSQLHttpServer.Create(PORT,[]); | |
fHTTPServer.AccessControlAllowOrigin:='*'; | |
finally | |
fHTTPServer.Free; | |
end; | |
except | |
on E:Exception do Application.MessageBox(PChar(E.Message),PChar(Application.Title), MB_OK + MB_ICONSTOP +MB_DEFBUTTON2); | |
end; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment