Skip to content

Commit a4a495c

Browse files
committed
These are what I learned in 2017-10-05.
1 parent f1501f6 commit a4a495c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- Date : 2017-10-05
2+
- Tags : #bash #python
3+
4+
## Simple HTTP server function helper
5+
6+
I use python3 (3.4+) to create a bash function to help me start quickly a simple http server on specified port
7+
8+
```bash
9+
function server() {
10+
local port="${1:-8000}" # Getting port number
11+
google-chrome "http://127.0.0.1:$port" # Open URL in browser, could change to firefox --new-tab "http://127.0.0.1:$port"
12+
python3 -m http.server $port --bind 127.0.0.1
13+
}
14+
```
15+

0 commit comments

Comments
 (0)