DEBUG -> PRODUCTION
This commit is contained in:
parent
c4c3d0b10d
commit
0691d69f19
29
scaffold.hs
29
scaffold.hs
@ -113,7 +113,6 @@ Flag production
|
|||||||
executable simple-server
|
executable simple-server
|
||||||
if flag(production)
|
if flag(production)
|
||||||
Buildable: False
|
Buildable: False
|
||||||
cpp-options: -DDEBUG
|
|
||||||
main-is: simple-server.hs
|
main-is: simple-server.hs
|
||||||
build-depends: base >= 4 && < 5,
|
build-depends: base >= 4 && < 5,
|
||||||
yesod >= 0.5 && < 0.6,
|
yesod >= 0.5 && < 0.6,
|
||||||
@ -132,6 +131,7 @@ executable fastcgi
|
|||||||
Buildable: True
|
Buildable: True
|
||||||
else
|
else
|
||||||
Buildable: False
|
Buildable: False
|
||||||
|
cpp-options: -DPRODUCTION
|
||||||
main-is: fastcgi.hs
|
main-is: fastcgi.hs
|
||||||
build-depends: wai-handler-fastcgi
|
build-depends: wai-handler-fastcgi
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
@ -351,7 +351,6 @@ with~sitearg~ f = Settings.withConnectionPool $ \p -> do
|
|||||||
module Handler.Root where
|
module Handler.Root where
|
||||||
|
|
||||||
import ~sitearg~
|
import ~sitearg~
|
||||||
import Control.Applicative
|
|
||||||
|
|
||||||
getRootR :: Handler RepHtml
|
getRootR :: Handler RepHtml
|
||||||
getRootR = do
|
getRootR = do
|
||||||
@ -406,31 +405,31 @@ import Database.Persist.Sqlite
|
|||||||
import Yesod (MonadCatchIO)
|
import Yesod (MonadCatchIO)
|
||||||
|
|
||||||
hamletFile :: FilePath -> Q Exp
|
hamletFile :: FilePath -> Q Exp
|
||||||
#ifdef DEBUG
|
#ifdef PRODUCTION
|
||||||
hamletFile x = H.hamletFileDebug $ "hamlet/" ++ x ++ ".hamlet"
|
|
||||||
#else
|
|
||||||
hamletFile x = H.hamletFile $ "hamlet/" ++ x ++ ".hamlet"
|
hamletFile x = H.hamletFile $ "hamlet/" ++ x ++ ".hamlet"
|
||||||
|
#else
|
||||||
|
hamletFile x = H.hamletFileDebug $ "hamlet/" ++ x ++ ".hamlet"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cassiusFile :: FilePath -> Q Exp
|
cassiusFile :: FilePath -> Q Exp
|
||||||
#ifdef DEBUG
|
#ifdef PRODUCTION
|
||||||
cassiusFile x = H.cassiusFileDebug $ "cassius/" ++ x ++ ".cassius"
|
|
||||||
#else
|
|
||||||
cassiusFile x = H.cassiusFile $ "cassius/" ++ x ++ ".cassius"
|
cassiusFile x = H.cassiusFile $ "cassius/" ++ x ++ ".cassius"
|
||||||
|
#else
|
||||||
|
cassiusFile x = H.cassiusFileDebug $ "cassius/" ++ x ++ ".cassius"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
juliusFile :: FilePath -> Q Exp
|
juliusFile :: FilePath -> Q Exp
|
||||||
#ifdef DEBUG
|
#ifdef PRODUCTION
|
||||||
juliusFile x = H.juliusFileDebug $ "julius/" ++ x ++ ".julius"
|
|
||||||
#else
|
|
||||||
juliusFile x = H.juliusFile $ "julius/" ++ x ++ ".julius"
|
juliusFile x = H.juliusFile $ "julius/" ++ x ++ ".julius"
|
||||||
|
#else
|
||||||
|
juliusFile x = H.juliusFileDebug $ "julius/" ++ x ++ ".julius"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connStr :: String
|
connStr :: String
|
||||||
#ifdef DEBUG
|
#ifdef PRODUCTION
|
||||||
connStr = "debug.db3"
|
|
||||||
#else
|
|
||||||
connStr = "production.db3"
|
connStr = "production.db3"
|
||||||
|
#else
|
||||||
|
connStr = "debug.db3"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connectionCount :: Int
|
connectionCount :: Int
|
||||||
@ -443,7 +442,7 @@ runConnectionPool :: MonadCatchIO m => SqlPersist m a -> ConnectionPool -> m a
|
|||||||
runConnectionPool = runSqlPool
|
runConnectionPool = runSqlPool
|
||||||
|
|
||||||
approot :: String
|
approot :: String
|
||||||
#ifdef DEBUG
|
#ifdef PRODUCTION
|
||||||
approot = "http://localhost:3000"
|
approot = "http://localhost:3000"
|
||||||
#else
|
#else
|
||||||
approot = "http://localhost:3000"
|
approot = "http://localhost:3000"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user