Added devel-server executable to scaffolded site
This commit is contained in:
parent
83368b05fd
commit
d741e335c4
@ -49,6 +49,7 @@ main = do
|
|||||||
|
|
||||||
writeFile' "simple-server.hs" $(codegen "simple-server_hs")
|
writeFile' "simple-server.hs" $(codegen "simple-server_hs")
|
||||||
writeFile' "fastcgi.hs" $(codegen "fastcgi_hs")
|
writeFile' "fastcgi.hs" $(codegen "fastcgi_hs")
|
||||||
|
writeFile' "devel-server.hs" $(codegen "devel-server_hs")
|
||||||
writeFile' (project ++ ".cabal") $(codegen "cabal")
|
writeFile' (project ++ ".cabal") $(codegen "cabal")
|
||||||
writeFile' "LICENSE" $(codegen "LICENSE")
|
writeFile' "LICENSE" $(codegen "LICENSE")
|
||||||
writeFile' (sitearg ++ ".hs") $(codegen "sitearg_hs")
|
writeFile' (sitearg ++ ".hs") $(codegen "sitearg_hs")
|
||||||
|
|||||||
@ -32,6 +32,13 @@ executable simple-server
|
|||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
extensions: TemplateHaskell, QuasiQuotes, TypeFamilies
|
extensions: TemplateHaskell, QuasiQuotes, TypeFamilies
|
||||||
|
|
||||||
|
executable devel-server
|
||||||
|
if flag(production)
|
||||||
|
Buildable: False
|
||||||
|
main-is: devel-server.hs
|
||||||
|
build-depends: wai-handler-devel >= 0.1.0 && < 0.2
|
||||||
|
ghc-options: -Wall -O2
|
||||||
|
|
||||||
executable fastcgi
|
executable fastcgi
|
||||||
if flag(production)
|
if flag(production)
|
||||||
Buildable: True
|
Buildable: True
|
||||||
|
|||||||
23
scaffold/devel-server_hs.cg
Normal file
23
scaffold/devel-server_hs.cg
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import Network.Wai.Handler.DevelServer (run)
|
||||||
|
import Control.Concurrent (forkIO)
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main = do
|
||||||
|
mapM_ putStrLn
|
||||||
|
[ "Starting your server process. Code changes will be automatically"
|
||||||
|
, "loaded as you save your files. Type \"quit\" to exit."
|
||||||
|
, "You can view your app at http://localhost:3000/"
|
||||||
|
, ""
|
||||||
|
]
|
||||||
|
_ <- forkIO () run 3000 "Controller" "with~sitearg~"
|
||||||
|
[ "hamlet"
|
||||||
|
, "cassius"
|
||||||
|
, "julius"
|
||||||
|
]
|
||||||
|
go
|
||||||
|
where
|
||||||
|
go = do
|
||||||
|
x <- getLine
|
||||||
|
case x of
|
||||||
|
'q':_ -> putStrLn "Quitting, goodbye!"
|
||||||
|
_ -> go
|
||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod
|
name: yesod
|
||||||
version: 0.5.0.4
|
version: 0.5.1
|
||||||
license: BSD3
|
license: BSD3
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user