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

many change
author taiki
date Tue, 10 Dec 2013 15:31:33 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/seminar/io2012slides/serve.sh	Tue Dec 10 15:31:33 2013 +0900
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Starts a basic web server on the port specified.
+# 
+# ./serve.sh 3000 -> http://localhost:3000
+#
+# Copyright 2012 Eric Bidelman <ebidel@gmail.com>
+
+port=$1
+if [ $#  -ne  1 ]
+then
+  port=8000
+fi
+
+if [ $(uname -s) == "Darwin" ]
+then
+  open=open
+else
+  open=xdg-open
+fi
+
+$open http://localhost:$port/template.html && python -m SimpleHTTPServer $port;