Handler->Application, ~sitearg~.hs->Foundation.hs
This commit is contained in:
parent
d535720a0b
commit
678288db13
@ -83,7 +83,7 @@ devel cabalCmd = do
|
||||
, concat
|
||||
[ "import \""
|
||||
, pi'
|
||||
, "\" Handler (withDevelAppPort)"
|
||||
, "\" Application (withDevelAppPort)"
|
||||
]
|
||||
, "import Data.Dynamic (fromDynamic)"
|
||||
, "import Network.Wai.Handler.Warp (run)"
|
||||
|
||||
@ -158,11 +158,11 @@ scaffold = do
|
||||
|
||||
writeFile' ("config/settings.yml") $(codegen "config/settings.yml")
|
||||
writeFile' ("main.hs") $(codegen "main.hs")
|
||||
writeFile' (project ++ ".cabal") $ ifTiny $(codegen "tiny/cabal") $(codegen "project.cabal")
|
||||
writeFile' (project ++ ".cabal") $ ifTiny $(codegen "tiny/project.cabal") $(codegen "project.cabal")
|
||||
writeFile' ".ghci" $(codegen ".ghci")
|
||||
writeFile' "LICENSE" $(codegen "LICENSE")
|
||||
writeFile' (sitearg ++ ".hs") $ ifTiny $(codegen "tiny/sitearg.hs") $(codegen "sitearg.hs")
|
||||
writeFile' "Handler.hs" $ ifTiny $(codegen "tiny/Handler.hs") $(codegen "Handler.hs")
|
||||
writeFile' ("Foundation.hs") $ ifTiny $(codegen "tiny/Foundation.hs") $(codegen "Foundation.hs")
|
||||
writeFile' "Application.hs" $ ifTiny $(codegen "tiny/Application.hs") $(codegen "Application.hs")
|
||||
writeFile' "Handler/Root.hs" $ ifTiny $(codegen "tiny/Handler/Root.hs") $(codegen "Handler/Root.hs")
|
||||
unless isTiny $ writeFile' "Model.hs" $(codegen "Model.hs")
|
||||
writeFile' "config/Settings.hs" $ ifTiny $(codegen "tiny/config/Settings.hs") $(codegen "config/Settings.hs")
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
||||
module Handler
|
||||
module Application
|
||||
( with~sitearg~
|
||||
, withDevelAppPort
|
||||
) where
|
||||
|
||||
import ~sitearg~
|
||||
import Foundation
|
||||
import Settings
|
||||
import Yesod.Static
|
||||
import Yesod.Auth
|
||||
@ -27,7 +27,7 @@ import Control.Concurrent.MVar (newEmptyMVar, putMVar, takeMVar)
|
||||
import Handler.Root
|
||||
|
||||
-- This line actually creates our YesodSite instance. It is the second half
|
||||
-- of the call to mkYesodData which occurs in ~sitearg~.hs. Please see
|
||||
-- of the call to mkYesodData which occurs in Foundation.hs. Please see
|
||||
-- the comments there for more details.
|
||||
mkYesodDispatch "~sitearg~" resources~sitearg~
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-}
|
||||
{-# LANGUAGE OverloadedStrings, MultiParamTypeClasses #-}
|
||||
module ~sitearg~
|
||||
module Foundation
|
||||
( ~sitearg~ (..)
|
||||
, ~sitearg~Route (..)
|
||||
, resources~sitearg~
|
||||
@ -1,7 +1,7 @@
|
||||
{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings #-}
|
||||
module Handler.Root where
|
||||
|
||||
import ~sitearg~
|
||||
import Foundation
|
||||
|
||||
-- This is a handler function for the GET request method on the RootR
|
||||
-- resource pattern. All of your resource patterns are defined in
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
-- includes database connection settings, static file locations, etc.
|
||||
-- In addition, you can configure a number of different aspects of Yesod
|
||||
-- by overriding methods in the Yesod typeclass. That instance is
|
||||
-- declared in the ~sitearg~.hs file.
|
||||
-- declared in the Foundation.hs file.
|
||||
module Settings
|
||||
( hamletFile
|
||||
, cassiusFile
|
||||
@ -49,7 +49,7 @@ data AppEnvironment = Test
|
||||
-- Use dynamic settings to avoid the need to re-compile the application (between staging and production environments).
|
||||
--
|
||||
-- By convention these settings should be overwritten by any command line arguments.
|
||||
-- See config/~sitearg~.hs for command line arguments
|
||||
-- See config/Foundation.hs for command line arguments
|
||||
-- Command line arguments provide some convenience but are also required for hosting situations where a setting is read from the environment (appPort on Heroku).
|
||||
--
|
||||
data AppConfig = AppConfig {
|
||||
@ -111,10 +111,10 @@ staticDir = "static"
|
||||
-- please see:
|
||||
-- http://code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain
|
||||
--
|
||||
-- If you change the resource pattern for StaticR in ~sitearg~.hs, you will
|
||||
-- If you change the resource pattern for StaticR in Foundation.hs, you will
|
||||
-- have to make a corresponding change here.
|
||||
--
|
||||
-- To see how this value is used, see urlRenderOverride in ~sitearg~.hs
|
||||
-- To see how this value is used, see urlRenderOverride in Foundation.hs
|
||||
staticRoot :: AppConfig -> Text
|
||||
staticRoot conf = [st|#{appRoot conf}/static|]
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{-# LANGUAGE CPP, DeriveDataTypeable #-}
|
||||
import qualified Settings as Settings
|
||||
import Settings (AppConfig(..))
|
||||
import Handler (with~sitearg~)
|
||||
import Application (with~sitearg~)
|
||||
import Network.Wai.Handler.Warp (run)
|
||||
import System.Console.CmdArgs hiding (args)
|
||||
import Data.Char (toUpper, toLower)
|
||||
|
||||
@ -25,9 +25,9 @@ library
|
||||
Buildable: True
|
||||
else
|
||||
Buildable: False
|
||||
exposed-modules: Handler
|
||||
exposed-modules: Application
|
||||
hs-source-dirs: ., config
|
||||
other-modules: ~sitearg~
|
||||
other-modules: Foundation
|
||||
Model
|
||||
Settings
|
||||
StaticFiles
|
||||
|
||||
@ -7,7 +7,7 @@ module Handler
|
||||
, withDevelApp
|
||||
) where
|
||||
|
||||
import ~sitearg~
|
||||
import Foundation
|
||||
import Settings
|
||||
import Yesod.Static
|
||||
import Yesod.Logger (makeLogger, flushLogger, Logger)
|
||||
@ -19,7 +19,7 @@ import Data.Dynamic (Dynamic, toDyn)
|
||||
import Handler.Root
|
||||
|
||||
-- This line actually creates our YesodSite instance. It is the second half
|
||||
-- of the call to mkYesodData which occurs in ~sitearg~.hs. Please see
|
||||
-- of the call to mkYesodData which occurs in Foundation.hs. Please see
|
||||
-- the comments there for more details.
|
||||
mkYesodDispatch "~sitearg~" resources~sitearg~
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module ~sitearg~
|
||||
module Foundation
|
||||
( ~sitearg~ (..)
|
||||
, ~sitearg~Route (..)
|
||||
, resources~sitearg~
|
||||
@ -27,7 +27,7 @@ library
|
||||
Buildable: False
|
||||
exposed-modules: Handler
|
||||
hs-source-dirs: ., config
|
||||
other-modules: ~sitearg~
|
||||
other-modules: Foundation
|
||||
Settings
|
||||
StaticFiles
|
||||
Handler.Root
|
||||
@ -11,7 +11,7 @@ cabal clean && cabal install && cabal sdist
|
||||
for f in $(ls -1rt dist/*.tar.gz | tail -1)
|
||||
do
|
||||
tar -xzvf $f && cd `basename $f .tar.gz`
|
||||
shelltest ../tests/scaffold.shelltest --color --diff $@ -- --hide-successes
|
||||
shelltest ../test/scaffold.shelltest --color --diff $@ -- --hide-successes
|
||||
cd ..
|
||||
rm -r `basename $f .tar.gz`
|
||||
done
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# Important! run with tests/run.sh
|
||||
# Important! run with test/run.sh
|
||||
|
||||
rm -rf foobar && runghc scaffold.hs init && cd foobar && cabal install && cabal install -fdevel && cd ..
|
||||
<<<
|
||||
|
||||
@ -20,12 +20,12 @@ extra-source-files:
|
||||
scaffold/cassius/default-layout.cassius.cg
|
||||
scaffold/cassius/homepage.cassius.cg
|
||||
scaffold/Model.hs.cg
|
||||
scaffold/sitearg.hs.cg
|
||||
scaffold/Foundation.hs.cg
|
||||
scaffold/LICENSE.cg
|
||||
scaffold/mongoDBConnPool.cg
|
||||
scaffold/tiny/sitearg.hs.cg
|
||||
scaffold/tiny/cabal.cg
|
||||
scaffold/tiny/Handler.hs.cg
|
||||
scaffold/tiny/Foundation.hs.cg
|
||||
scaffold/tiny/project.cabal.cg
|
||||
scaffold/tiny/Application.hs.cg
|
||||
scaffold/tiny/hamlet/homepage.hamlet.cg
|
||||
scaffold/tiny/Handler/Root.hs.cg
|
||||
scaffold/tiny/config/routes.cg
|
||||
@ -35,7 +35,7 @@ extra-source-files:
|
||||
scaffold/sqliteConnPool.cg
|
||||
scaffold/.ghci.cg
|
||||
scaffold/project.cabal.cg
|
||||
scaffold/Handler.hs.cg
|
||||
scaffold/Application.hs.cg
|
||||
scaffold/julius/homepage.julius.cg
|
||||
scaffold/hamlet/homepage.hamlet.cg
|
||||
scaffold/hamlet/default-layout.hamlet.cg
|
||||
|
||||
Loading…
Reference in New Issue
Block a user