Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 27 lines (23 sloc) 0.7 kb
cb839d8 @konn first commit
authored
1 {-# LANGUAGE PackageImports #-}
2 import "Yablog" Application (getApplicationDev)
3 import Network.Wai.Handler.Warp
4 (runSettings, defaultSettings, settingsPort)
5 import Control.Concurrent (forkIO)
6 import System.Directory (doesFileExist, removeFile)
7 import System.Exit (exitSuccess)
8 import Control.Concurrent (threadDelay)
9
10 main :: IO ()
11 main = do
12 putStrLn "Starting devel application"
13 (port, app) <- getApplicationDev
14 forkIO $ runSettings defaultSettings
15 { settingsPort = port
16 } app
17 loop
18
19 loop :: IO ()
20 loop = do
21 threadDelay 100000
22 e <- doesFileExist "dist/devel-terminate"
23 if e then terminateDevel else loop
24
25 terminateDevel :: IO ()
26 terminateDevel = exitSuccess
Something went wrong with that request. Please try again.