Skip to main content

Try SimpleHTTPServer:

python3 -m http.server 8080

Or, for Python 2

python -m SimpleHTTPServer 8080

To bind an IP Address, do

python -m SimpleHTTPServer 8080 -b 0.0.0.0

or for Python 3

python3 -m http.server 8080 -b 0.0.0.0

It will serve whatever's in the CWD (e.g. index.html) at http://0.0.0.0:8000.

Try SimpleHTTPServer:

python3 -m http.server 8080

Or, for Python 2

python -m SimpleHTTPServer 8080

It will serve whatever's in the CWD (e.g. index.html) at http://0.0.0.0:8000.

Try SimpleHTTPServer:

python3 -m http.server 8080

Or, for Python 2

python -m SimpleHTTPServer 8080

To bind an IP Address, do

python -m SimpleHTTPServer 8080 -b 0.0.0.0

or for Python 3

python3 -m http.server 8080 -b 0.0.0.0

It will serve whatever's in the CWD (e.g. index.html) at http://0.0.0.0:8000.

Python3 by default. Added example port. Improved formatting. Minor fixes
Source Link
Pablo A
  • 3.2k
  • 1
  • 26
  • 46

Try SimpleHTTPServer:

pythonpython3 -m SimpleHTTPServer
# or the Python 3http.server equivalent8080
python3

Or, for Python 2

python -m http.serverSimpleHTTPServer 8080

It should will serve whatever's in the CWD (e.g. index.html) at http://0.0.0.0:8000.

Try SimpleHTTPServer:

python -m SimpleHTTPServer
# or the Python 3 equivalent
python3 -m http.server

It should will serve whatever's in the CWD (e.g. index.html) at http://0.0.0.0:8000.

Try SimpleHTTPServer:

python3 -m http.server 8080

Or, for Python 2

python -m SimpleHTTPServer 8080

It will serve whatever's in the CWD (e.g. index.html) at http://0.0.0.0:8000.

from comment
Source Link
tshepang
  • 67.7k
  • 94
  • 226
  • 297

Try SimpleHTTPServer.:

python -m SimpleHTTPServer
# or the Python 3 equivalent
python3 -m http.server

python -m SimpleHTTPServer It should do it—it'llwill serve whatever's in the CWD (e.g. index.html) at http://0.0.0.0:8000.

Try SimpleHTTPServer.

python -m SimpleHTTPServer should do it—it'll serve whatever's in the CWD (e.g. index.html) at http://0.0.0.0:8000

Try SimpleHTTPServer:

python -m SimpleHTTPServer
# or the Python 3 equivalent
python3 -m http.server

It should will serve whatever's in the CWD (e.g. index.html) at http://0.0.0.0:8000.

Source Link
Olivier Lalonde
  • 5.5k
  • 6
  • 26
  • 20
Loading