hupili / datavis.studio

data-viz course/ slides/ projects
http://datavis.studio/
6 stars 6 forks source link

Simple HTTP request handler #9

Open ivywze opened 5 years ago

ivywze commented 5 years ago

Use SimpleHTTPServer for request handler in Terminal.

local Terminal

input:

$ cd 👉[path to working folder here]
$ python -m SimpleHTTPServer

output:

Serving HTTP on 0.0.0.0 port 8000 ...

Open browser and input:

http://localhost:8000

VS code

Find Terminal on the navigation bar and open new terminal.

Follow the steps above, no need to change direction at this time.

change port

corresponding input change to: python -m SimpleHTTPServer 8080

For python3

corresponding input change to: python3 -m http.server or python -m http.server

Warning

SimpleHTTPServer is not recommended for production. It only implements basic security checks.