Skip to content
Browse files

Support passing in port number

  • Loading branch information...
1 parent c0abd64 commit f7a878755d272532b37b3e2204ad62d413b6a0b8 @singpolyma committed Mar 23, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 Main.hs
View
8 Main.hs
@@ -36,10 +36,12 @@ main = do
let root = fmap addTrailingSlash (parseAbsoluteURI =<< headMay args)
main' root args
where
- main' (Just root@(URI {uriAuthority = Just _})) (_:dbpth:_) = do
+ main' (Just root@(URI {uriAuthority = Just _})) (_:dbpth:port:_) = do
cwd <- getWorkingDirectory
void $ withConnection dbpth
- (run 3000 .
+ (run (read port) .
logStdoutDev . autohead . acceptOverride . jsonp . -- Middleware
dispatch (staticRoot cwd) . routes root) -- Do routing
- main' _ _ = err "Usage: ./Main <Root URI> <DB path>"
+ main' root@(Just (URI {uriAuthority = Just _})) (_:dbpth:_) =
+ main' root [dbpth, "3000"]
+ main' _ _ = err "Usage: ./Main <Root URI> <DB path> <port>"

0 comments on commit f7a8787

Please sign in to comment.
Something went wrong with that request. Please try again.