Search notes:

Script: websrv

websrv starts a webserver whose content root directory is the current directory. This script comes as Shell script, batch file and PowerShell script.

Shell script

port=${1:-80}

if [ $port -lt 1024 ]; then
  sudo=sudo
else
  local sudo=""
fi

$sudo python3 -m http.server $port
Github repository scripts-and-utilities, path: /websrv

Batch file

@rem  --------------------------------------------------------------------------------------
@rem  --- U  n  i  f  o  r  m    S  e  r  v  e  r                                        ---
@rem  --- Command line arguments for Uniform Server:                                     ---
@rem  --- http://www.uniformserver.com/ZeroXI_documentation/command_line_parameters.html ---
@rem  ---                                                                                ---
@start    c:\tools\UniServerZ\UniController.exe start_both
@rem  --------------------------------------------------------------------------------------


@rem  --------------------------------------------------------------------------------------
@rem  --- HTTP::Server::Simple::CGI                                                      ---
@rem  @%github_root%PerlModules\HTTP\Server\Simple\CGI\webserver.pl
@rem  --------------------------------------------------------------------------------------
Github repository scripts-and-utilities, path: /websrv.bat

PowerShell script

 # python -m http.server 80
 py -m http.server 80
Github repository scripts-and-utilities, path: /websrv.ps1
Update 2022-07-12: call with py rather than python.

See also

The Perl Module HTTP::Server::Simple::CGI
Scripts

Index