mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 05:08:06 +02:00
pas2js: httpcompiler: fixed reading values fomr config file
This commit is contained in:
parent
61cf121533
commit
bad14c5dbd
@ -705,11 +705,14 @@ Var
|
||||
|
||||
begin
|
||||
Result:=False;
|
||||
FAPI:=GetOptionValue('A','api');
|
||||
FServeOnly:=HasOption('s','serve-only');
|
||||
Quiet:=HasOption('q','quiet');
|
||||
Port:=StrToIntDef(GetOptionValue('p','port'),3000);
|
||||
D:=GetOptionValue('d','directory');
|
||||
if HasOption('A','api') then
|
||||
FAPI:=GetOptionValue('A','api');
|
||||
FServeOnly:=FServeOnly or HasOption('s','serve-only');
|
||||
Quiet:=Quiet or HasOption('q','quiet');
|
||||
if (Port=0) or HasOption('p','port') then
|
||||
Port:=StrToIntDef(GetOptionValue('p','port'),3000);
|
||||
if HasOption('d','directory') then
|
||||
D:=GetOptionValue('d','directory');
|
||||
if D='' then
|
||||
D:=GetCurrentDir;
|
||||
if HasOption('m','mimetypes') then
|
||||
@ -734,9 +737,11 @@ begin
|
||||
Log(etInfo,'Listening on port %d, serving files from directory: %s',[Port,D]);
|
||||
if ServeOnly then
|
||||
Log(etInfo,'Compile requests will be ignored.');
|
||||
If not HasOption('n','noindexpage') then
|
||||
begin
|
||||
NoIndexPage:=NoIndexPage or HasOption('n','noindexpage');
|
||||
if HasOption('i','indexpage') then
|
||||
IndexPage:=GetOptionValue('i','indexpage');
|
||||
If not NoIndexPage then
|
||||
begin
|
||||
if (IndexPage='') then
|
||||
IndexPage:='index.html';
|
||||
Log(etInfo,'Using index page %s',[IndexPage]);
|
||||
|
Loading…
Reference in New Issue
Block a user