forked from yesodweb/yesod
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devel.hs is a normal scaffolded file
- Loading branch information
Showing
4 changed files
with
30 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{-# LANGUAGE PackageImports #-} | ||
import "~project~" Application (getApplicationDev) | ||
import Network.Wai.Handler.Warp | ||
(runSettings, defaultSettings, settingsPort, settingsHost) | ||
import Control.Concurrent (forkIO) | ||
import System.Directory (doesFileExist, removeFile) | ||
import System.Exit (exitSuccess) | ||
import Control.Concurrent (threadDelay) | ||
|
||
main :: IO () | ||
main = do | ||
putStrLn "Starting devel application" | ||
(port, app) <- getApplicationDev | ||
forkIO $ runSettings defaultSettings | ||
{ settingsPort = port | ||
, settingsHost = "0.0.0.0" | ||
} app | ||
loop | ||
|
||
loop :: IO () | ||
loop = do | ||
threadDelay 100000 | ||
e <- doesFileExist "dist/devel-terminate" | ||
if e then terminateDevel else loop | ||
|
||
terminateDevel :: IO () | ||
terminateDevel = exitSuccess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters