Webdev 101
03 Jan 2022
Start a local web server
- (optional) Start docker container and expose port 8000
docker run -it -p 8000:8000 --entrypoint bash -w /home -v $PWD:/home default:1.0
- Start web server using Python (use port 8000 by default)
python -m http.server
- Access that web site from another machine on my network
use URL
http://<local_ip_address>:8000
you can find your local ip address by doing ipconfig getifaddr en0
when conected to wifi.
Note that for some reason, you can’t use localhost
on Chrome and instead need to use 127.0.0.1
, which is the same in the end.
The answer to that StackOverflow question provides a fix.
[
webdev
]