mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-09-13 11:49:06 +02:00
demo: fixed restserver on darwin
This commit is contained in:
parent
a73cf3423a
commit
9f8fcf5d38
@ -2,6 +2,10 @@ program restserver;
|
||||
|
||||
uses sysutils,custhttpapp, fpwebfile, httproute, restdata;
|
||||
|
||||
{$IF FPC_FULLVERSION<30101}
|
||||
{$ERROR You need at least fpc 3.1.1}
|
||||
{$ENDIF}
|
||||
|
||||
Type
|
||||
|
||||
{ THTTPApplication }
|
||||
@ -63,9 +67,13 @@ begin
|
||||
if D='' then
|
||||
D:=GetCurrentDir;
|
||||
Log(etInfo,'Listening on port %d, serving files from directory: %s',[Port,D]);
|
||||
{$ifdef unix}
|
||||
MimeTypesFile:='/etc/mime.types';
|
||||
{$endif}
|
||||
{$IFDEF darwin}
|
||||
MimeTypesFile:='/private/etc/apache2/mime.types';
|
||||
{$else}
|
||||
{$ifdef unix}
|
||||
MimeTypesFile:='/etc/mime.types';
|
||||
{$endif}
|
||||
{$endif}
|
||||
TSimpleFileModule.BaseDir:=IncludeTrailingPathDelimiter(D);
|
||||
TSimpleFileModule.OnLog:=@Log;
|
||||
If not HasOption('n','noindexpage') then
|
||||
|
Loading…
Reference in New Issue
Block a user