comparison seminar/io2012slides/serve.sh @ 3:fea44bb81877 default tip

many change
author taiki
date Tue, 10 Dec 2013 15:31:33 +0900
parents
children
comparison
equal deleted inserted replaced
2:7f4128b2369a 3:fea44bb81877
1 #!/bin/bash
2 #
3 # Starts a basic web server on the port specified.
4 #
5 # ./serve.sh 3000 -> http://localhost:3000
6 #
7 # Copyright 2012 Eric Bidelman <ebidel@gmail.com>
8
9 port=$1
10 if [ $# -ne 1 ]
11 then
12 port=8000
13 fi
14
15 if [ $(uname -s) == "Darwin" ]
16 then
17 open=open
18 else
19 open=xdg-open
20 fi
21
22 $open http://localhost:$port/template.html && python -m SimpleHTTPServer $port;