diff basicweb.rhope @ 146:1f39e69446f9

Finished porting webserver
author Mike Pavone <pavone@retrodev.com>
date Sun, 21 Nov 2010 22:47:14 -0500
parents 6202b866d72c
children f3686f60985d
line wrap: on
line diff
--- a/basicweb.rhope	Sun Nov 21 22:08:17 2010 -0500
+++ b/basicweb.rhope	Sun Nov 21 22:47:14 2010 -0500
@@ -5,12 +5,15 @@
 //Import the library that does all the hard work
 Import webserver.rhope
 
-Main[]
+Main[args]
 {
+	[args]Index[1]
+	{ port <- Int32[~] }
+	{ port <- 80 }
 	Print["Starting webserver"]
 	//Since we're just serving static files we don't need to setup any handlers
 	handlers <- Dictionary[]
-	//Start listening on port 80
-	Listen on Port[80,["Connection Start"]Set Input[1, handlers]]
-	Wait Forever[]
+	//Start listening on the desired port
+	Listen on Port[port,Connection Start[?, ?, handlers]]
+	{ Wait Forever[] }
 }