25 lines
490 B
Haskell
25 lines
490 B
Haskell
|
import Network.Wai
|
||
|
import Network.Wai.Handler.Warp
|
||
|
import System.Environment
|
||
|
|
||
|
import qualified GS1
|
||
|
import qualified GS2
|
||
|
|
||
|
app :: String -> Maybe Application
|
||
|
app n = case n of
|
||
|
"1" -> Just GS1.app
|
||
|
"2" -> Just GS2.app
|
||
|
_ -> Nothing
|
||
|
|
||
|
main :: IO ()
|
||
|
main = do
|
||
|
args <- getArgs
|
||
|
case args of
|
||
|
[n] -> maybe usage (run 8081) (app n)
|
||
|
_ -> usage
|
||
|
|
||
|
usage :: IO ()
|
||
|
usage = do
|
||
|
putStrLn "Usage:\t getting-started N"
|
||
|
putStrLn "\t\twhere N is the number of the example you want to run."
|