I tried collecting one-liner Web servers
I always read this article because I forget how to write it 100% every time I start the one-liner web server, but since it starts from searching for the article every time, I summarized it in a shell script.
https://github.com/5t111111/http-server-one-liner
A wrapper script that launches one of the following web servers:
The default is Python 2.x or 3.x. It depends on the environment.
Usage
$httpserver program port number
#Default(Python 2.x or 3.x)The port number is also the default one
$ httpserver
#Default(Python 2.x or 3.x)With port number specified
$ httpserver 8080
# Python 2.x or 3.x
$ httpserver python 8080
# Python 3.x
$ httpserver python3 8080
# Ruby
$ httpserver ruby 8080
# PHP
$ httpserver php 8080
Clone the repository to a suitable location or download the script file and put it in the path.
$ cd ~
$ git clone [email protected]:5t111111/http-server-one-liner.git
$ export PATH=$HOME/http-server-one-liner:$PATH
$ rehash #option
Recommended Posts