Scaffolding update
This commit is contained in:
parent
f5a9dae1ea
commit
c1f1e91fa9
@ -1,3 +1,11 @@
|
|||||||
|
## 1.4.2
|
||||||
|
|
||||||
|
Scaffolding updates:
|
||||||
|
|
||||||
|
* Import.NoFoundation
|
||||||
|
* Explanation of static files in Settings.StaticFiles
|
||||||
|
* Explanation of environment variables in settings.yml
|
||||||
|
|
||||||
## 1.4.1.2
|
## 1.4.1.2
|
||||||
|
|
||||||
No args passed in keter.yml
|
No args passed in keter.yml
|
||||||
|
|||||||
@ -148,14 +148,10 @@ appMain = do
|
|||||||
{-# START_FILE Foundation.hs #-}
|
{-# START_FILE Foundation.hs #-}
|
||||||
module Foundation where
|
module Foundation where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod
|
|
||||||
import Database.Persist.MongoDB hiding (master)
|
import Database.Persist.MongoDB hiding (master)
|
||||||
import Model
|
import Import.NoFoundation
|
||||||
import Settings
|
|
||||||
import Settings.StaticFiles
|
|
||||||
import Text.Hamlet (hamletFile)
|
import Text.Hamlet (hamletFile)
|
||||||
import Text.Jasmine (minifym)
|
import Text.Jasmine (minifym)
|
||||||
import Yesod.Auth
|
|
||||||
import Yesod.Auth.BrowserId (authBrowserId)
|
import Yesod.Auth.BrowserId (authBrowserId)
|
||||||
import Yesod.Core.Types (Logger)
|
import Yesod.Core.Types (Logger)
|
||||||
import Yesod.Default.Util (addStaticContentExternal)
|
import Yesod.Default.Util (addStaticContentExternal)
|
||||||
@ -368,8 +364,15 @@ module Import
|
|||||||
( module Import
|
( module Import
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod as Import
|
|
||||||
import Foundation as Import
|
import Foundation as Import
|
||||||
|
import Import.NoFoundation as Import
|
||||||
|
|
||||||
|
{-# START_FILE Import/NoFoundation.hs #-}
|
||||||
|
module Import.NoFoundation
|
||||||
|
( module Import
|
||||||
|
) where
|
||||||
|
|
||||||
|
import ClassyPrelude.Yesod as Import
|
||||||
import Model as Import
|
import Model as Import
|
||||||
import Settings as Import
|
import Settings as Import
|
||||||
import Settings.StaticFiles as Import
|
import Settings.StaticFiles as Import
|
||||||
@ -411,6 +414,7 @@ library
|
|||||||
exposed-modules: Application
|
exposed-modules: Application
|
||||||
Foundation
|
Foundation
|
||||||
Import
|
Import
|
||||||
|
Import.NoFoundation
|
||||||
Model
|
Model
|
||||||
Settings
|
Settings
|
||||||
Settings.StaticFiles
|
Settings.StaticFiles
|
||||||
@ -664,10 +668,18 @@ module Settings.StaticFiles where
|
|||||||
import Settings (appStaticDir, compileTimeAppSettings)
|
import Settings (appStaticDir, compileTimeAppSettings)
|
||||||
import Yesod.Static (staticFiles)
|
import Yesod.Static (staticFiles)
|
||||||
|
|
||||||
-- | This generates easy references to files in the static directory at compile time,
|
-- This generates easy references to files in the static directory at compile time,
|
||||||
-- giving you compile-time verification that referenced files exist.
|
-- giving you compile-time verification that referenced files exist.
|
||||||
-- Warning: any files added to your static directory during run-time can't be
|
-- Warning: any files added to your static directory during run-time can't be
|
||||||
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
||||||
|
--
|
||||||
|
-- For example, to refer to @static/js/script.js@ via an identifier, you'd use:
|
||||||
|
--
|
||||||
|
-- js_script_js
|
||||||
|
--
|
||||||
|
-- If the identifier is not available, you may use:
|
||||||
|
--
|
||||||
|
-- StaticFile ["js", "script.js"] []
|
||||||
staticFiles (appStaticDir compileTimeAppSettings)
|
staticFiles (appStaticDir compileTimeAppSettings)
|
||||||
|
|
||||||
{-# START_FILE app/DevelMain.hs #-}
|
{-# START_FILE app/DevelMain.hs #-}
|
||||||
@ -869,6 +881,9 @@ User-agent: *
|
|||||||
/ HomeR GET POST
|
/ HomeR GET POST
|
||||||
|
|
||||||
{-# START_FILE config/settings.yml #-}
|
{-# START_FILE config/settings.yml #-}
|
||||||
|
# Values formatted like "_env:ENV_VAR_NAME:default_value" can be overridden by the specified environment variable.
|
||||||
|
# See https://github.com/yesodweb/yesod/wiki/Configuration#overriding-configuration-values-with-environment-variables
|
||||||
|
|
||||||
static-dir: "_env:STATIC_DIR:static"
|
static-dir: "_env:STATIC_DIR:static"
|
||||||
host: "_env:HOST:*4" # any IPv4 host
|
host: "_env:HOST:*4" # any IPv4 host
|
||||||
port: "_env:PORT:3000"
|
port: "_env:PORT:3000"
|
||||||
|
|||||||
@ -164,17 +164,13 @@ appMain = do
|
|||||||
{-# START_FILE Foundation.hs #-}
|
{-# START_FILE Foundation.hs #-}
|
||||||
module Foundation where
|
module Foundation where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod
|
import Import.NoFoundation
|
||||||
import Database.Persist.Sql (ConnectionPool, runSqlPool)
|
import Database.Persist.Sql (ConnectionPool, runSqlPool)
|
||||||
import Model
|
|
||||||
import Settings
|
|
||||||
import Settings.StaticFiles
|
|
||||||
import Text.Hamlet (hamletFile)
|
import Text.Hamlet (hamletFile)
|
||||||
import Text.Jasmine (minifym)
|
import Text.Jasmine (minifym)
|
||||||
import Yesod.Auth
|
|
||||||
import Yesod.Auth.BrowserId (authBrowserId)
|
import Yesod.Auth.BrowserId (authBrowserId)
|
||||||
import Yesod.Core.Types (Logger)
|
|
||||||
import Yesod.Default.Util (addStaticContentExternal)
|
import Yesod.Default.Util (addStaticContentExternal)
|
||||||
|
import Yesod.Core.Types (Logger)
|
||||||
|
|
||||||
-- | The foundation datatype for your application. This can be a good place to
|
-- | The foundation datatype for your application. This can be a good place to
|
||||||
-- keep settings and values requiring initialization before your application
|
-- keep settings and values requiring initialization before your application
|
||||||
@ -383,8 +379,15 @@ module Import
|
|||||||
( module Import
|
( module Import
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod as Import
|
|
||||||
import Foundation as Import
|
import Foundation as Import
|
||||||
|
import Import.NoFoundation as Import
|
||||||
|
|
||||||
|
{-# START_FILE Import/NoFoundation.hs #-}
|
||||||
|
module Import.NoFoundation
|
||||||
|
( module Import
|
||||||
|
) where
|
||||||
|
|
||||||
|
import ClassyPrelude.Yesod as Import
|
||||||
import Model as Import
|
import Model as Import
|
||||||
import Settings as Import
|
import Settings as Import
|
||||||
import Settings.StaticFiles as Import
|
import Settings.StaticFiles as Import
|
||||||
@ -423,6 +426,7 @@ library
|
|||||||
exposed-modules: Application
|
exposed-modules: Application
|
||||||
Foundation
|
Foundation
|
||||||
Import
|
Import
|
||||||
|
Import.NoFoundation
|
||||||
Model
|
Model
|
||||||
Settings
|
Settings
|
||||||
Settings.StaticFiles
|
Settings.StaticFiles
|
||||||
@ -676,10 +680,18 @@ module Settings.StaticFiles where
|
|||||||
import Settings (appStaticDir, compileTimeAppSettings)
|
import Settings (appStaticDir, compileTimeAppSettings)
|
||||||
import Yesod.Static (staticFiles)
|
import Yesod.Static (staticFiles)
|
||||||
|
|
||||||
-- | This generates easy references to files in the static directory at compile time,
|
-- This generates easy references to files in the static directory at compile time,
|
||||||
-- giving you compile-time verification that referenced files exist.
|
-- giving you compile-time verification that referenced files exist.
|
||||||
-- Warning: any files added to your static directory during run-time can't be
|
-- Warning: any files added to your static directory during run-time can't be
|
||||||
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
||||||
|
--
|
||||||
|
-- For example, to refer to @static/js/script.js@ via an identifier, you'd use:
|
||||||
|
--
|
||||||
|
-- js_script_js
|
||||||
|
--
|
||||||
|
-- If the identifier is not available, you may use:
|
||||||
|
--
|
||||||
|
-- StaticFile ["js", "script.js"] []
|
||||||
staticFiles (appStaticDir compileTimeAppSettings)
|
staticFiles (appStaticDir compileTimeAppSettings)
|
||||||
|
|
||||||
{-# START_FILE app/DevelMain.hs #-}
|
{-# START_FILE app/DevelMain.hs #-}
|
||||||
@ -881,6 +893,9 @@ User-agent: *
|
|||||||
/ HomeR GET POST
|
/ HomeR GET POST
|
||||||
|
|
||||||
{-# START_FILE config/settings.yml #-}
|
{-# START_FILE config/settings.yml #-}
|
||||||
|
# Values formatted like "_env:ENV_VAR_NAME:default_value" can be overridden by the specified environment variable.
|
||||||
|
# See https://github.com/yesodweb/yesod/wiki/Configuration#overriding-configuration-values-with-environment-variables
|
||||||
|
|
||||||
static-dir: "_env:STATIC_DIR:static"
|
static-dir: "_env:STATIC_DIR:static"
|
||||||
host: "_env:HOST:*4" # any IPv4 host
|
host: "_env:HOST:*4" # any IPv4 host
|
||||||
port: "_env:PORT:3000"
|
port: "_env:PORT:3000"
|
||||||
|
|||||||
@ -170,13 +170,9 @@ appMain = do
|
|||||||
{-# START_FILE Foundation.hs #-}
|
{-# START_FILE Foundation.hs #-}
|
||||||
module Foundation where
|
module Foundation where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod
|
|
||||||
import Database.Persist.Sql (ConnectionPool, runSqlPool)
|
import Database.Persist.Sql (ConnectionPool, runSqlPool)
|
||||||
import Model
|
import Import.NoFoundation
|
||||||
import Settings
|
|
||||||
import Settings.StaticFiles
|
|
||||||
import Text.Hamlet (hamletFile)
|
import Text.Hamlet (hamletFile)
|
||||||
import Yesod.Auth
|
|
||||||
import Yesod.Auth.BrowserId (authBrowserId)
|
import Yesod.Auth.BrowserId (authBrowserId)
|
||||||
import Yesod.Core.Types (Logger)
|
import Yesod.Core.Types (Logger)
|
||||||
import Yesod.Default.Util (addStaticContentExternal)
|
import Yesod.Default.Util (addStaticContentExternal)
|
||||||
@ -417,21 +413,28 @@ module Import
|
|||||||
( module Import
|
( module Import
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod as Import
|
|
||||||
import Foundation as Import
|
import Foundation as Import
|
||||||
|
import Import.NoFoundation as Import
|
||||||
import Language.Haskell.TH.Syntax (Exp (ConE))
|
import Language.Haskell.TH.Syntax (Exp (ConE))
|
||||||
import Model as Import
|
|
||||||
import Settings as Import
|
|
||||||
import Settings.StaticFiles as Import
|
|
||||||
import SharedTypes as Import
|
|
||||||
import Yesod.Auth as Import
|
|
||||||
import Yesod.Core.Types as Import (loggerSet)
|
|
||||||
import Yesod.Default.Config2 as Import
|
|
||||||
import Yesod.Fay (FayFile)
|
import Yesod.Fay (FayFile)
|
||||||
|
|
||||||
fayFile :: FayFile
|
fayFile :: FayFile
|
||||||
fayFile = fayFile' (ConE 'StaticR)
|
fayFile = fayFile' (ConE 'StaticR)
|
||||||
|
|
||||||
|
{-# START_FILE Import/NoFoundation.hs #-}
|
||||||
|
module Import.NoFoundation
|
||||||
|
( module Import
|
||||||
|
) where
|
||||||
|
|
||||||
|
import ClassyPrelude.Yesod as Import
|
||||||
|
import Model as Import
|
||||||
|
import Settings as Import
|
||||||
|
import Settings.StaticFiles as Import
|
||||||
|
import SharedTypes as Import
|
||||||
|
import Yesod.Auth as Import
|
||||||
|
import Yesod.Core.Types as Import (loggerSet)
|
||||||
|
import Yesod.Default.Config2 as Import
|
||||||
|
|
||||||
{-# START_FILE Model.hs #-}
|
{-# START_FILE Model.hs #-}
|
||||||
module Model where
|
module Model where
|
||||||
|
|
||||||
@ -464,6 +467,7 @@ library
|
|||||||
exposed-modules: Application
|
exposed-modules: Application
|
||||||
Foundation
|
Foundation
|
||||||
Import
|
Import
|
||||||
|
Import.NoFoundation
|
||||||
Model
|
Model
|
||||||
Settings
|
Settings
|
||||||
Settings.StaticFiles
|
Settings.StaticFiles
|
||||||
@ -736,10 +740,18 @@ module Settings.StaticFiles where
|
|||||||
import Settings (appStaticDir, compileTimeAppSettings)
|
import Settings (appStaticDir, compileTimeAppSettings)
|
||||||
import Yesod.Static (staticFiles)
|
import Yesod.Static (staticFiles)
|
||||||
|
|
||||||
-- | This generates easy references to files in the static directory at compile time,
|
-- This generates easy references to files in the static directory at compile time,
|
||||||
-- giving you compile-time verification that referenced files exist.
|
-- giving you compile-time verification that referenced files exist.
|
||||||
-- Warning: any files added to your static directory during run-time can't be
|
-- Warning: any files added to your static directory during run-time can't be
|
||||||
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
||||||
|
--
|
||||||
|
-- For example, to refer to @static/js/script.js@ via an identifier, you'd use:
|
||||||
|
--
|
||||||
|
-- js_script_js
|
||||||
|
--
|
||||||
|
-- If the identifier is not available, you may use:
|
||||||
|
--
|
||||||
|
-- StaticFile ["js", "script.js"] []
|
||||||
staticFiles (appStaticDir compileTimeAppSettings)
|
staticFiles (appStaticDir compileTimeAppSettings)
|
||||||
|
|
||||||
{-# START_FILE app/DevelMain.hs #-}
|
{-# START_FILE app/DevelMain.hs #-}
|
||||||
@ -942,6 +954,9 @@ User-agent: *
|
|||||||
/ HomeR GET POST
|
/ HomeR GET POST
|
||||||
|
|
||||||
{-# START_FILE config/settings.yml #-}
|
{-# START_FILE config/settings.yml #-}
|
||||||
|
# Values formatted like "_env:ENV_VAR_NAME:default_value" can be overridden by the specified environment variable.
|
||||||
|
# See https://github.com/yesodweb/yesod/wiki/Configuration#overriding-configuration-values-with-environment-variables
|
||||||
|
|
||||||
static-dir: "_env:STATIC_DIR:static"
|
static-dir: "_env:STATIC_DIR:static"
|
||||||
host: "_env:HOST:*4" # any IPv4 host
|
host: "_env:HOST:*4" # any IPv4 host
|
||||||
port: "_env:PORT:3000"
|
port: "_env:PORT:3000"
|
||||||
|
|||||||
@ -164,17 +164,13 @@ appMain = do
|
|||||||
{-# START_FILE Foundation.hs #-}
|
{-# START_FILE Foundation.hs #-}
|
||||||
module Foundation where
|
module Foundation where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod
|
import Import.NoFoundation
|
||||||
import Database.Persist.Sql (ConnectionPool, runSqlPool)
|
import Database.Persist.Sql (ConnectionPool, runSqlPool)
|
||||||
import Model
|
|
||||||
import Settings
|
|
||||||
import Settings.StaticFiles
|
|
||||||
import Text.Hamlet (hamletFile)
|
import Text.Hamlet (hamletFile)
|
||||||
import Text.Jasmine (minifym)
|
import Text.Jasmine (minifym)
|
||||||
import Yesod.Auth
|
|
||||||
import Yesod.Auth.BrowserId (authBrowserId)
|
import Yesod.Auth.BrowserId (authBrowserId)
|
||||||
import Yesod.Core.Types (Logger)
|
|
||||||
import Yesod.Default.Util (addStaticContentExternal)
|
import Yesod.Default.Util (addStaticContentExternal)
|
||||||
|
import Yesod.Core.Types (Logger)
|
||||||
|
|
||||||
-- | The foundation datatype for your application. This can be a good place to
|
-- | The foundation datatype for your application. This can be a good place to
|
||||||
-- keep settings and values requiring initialization before your application
|
-- keep settings and values requiring initialization before your application
|
||||||
@ -383,8 +379,15 @@ module Import
|
|||||||
( module Import
|
( module Import
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod as Import
|
|
||||||
import Foundation as Import
|
import Foundation as Import
|
||||||
|
import Import.NoFoundation as Import
|
||||||
|
|
||||||
|
{-# START_FILE Import/NoFoundation.hs #-}
|
||||||
|
module Import.NoFoundation
|
||||||
|
( module Import
|
||||||
|
) where
|
||||||
|
|
||||||
|
import ClassyPrelude.Yesod as Import
|
||||||
import Model as Import
|
import Model as Import
|
||||||
import Settings as Import
|
import Settings as Import
|
||||||
import Settings.StaticFiles as Import
|
import Settings.StaticFiles as Import
|
||||||
@ -423,6 +426,7 @@ library
|
|||||||
exposed-modules: Application
|
exposed-modules: Application
|
||||||
Foundation
|
Foundation
|
||||||
Import
|
Import
|
||||||
|
Import.NoFoundation
|
||||||
Model
|
Model
|
||||||
Settings
|
Settings
|
||||||
Settings.StaticFiles
|
Settings.StaticFiles
|
||||||
@ -676,10 +680,18 @@ module Settings.StaticFiles where
|
|||||||
import Settings (appStaticDir, compileTimeAppSettings)
|
import Settings (appStaticDir, compileTimeAppSettings)
|
||||||
import Yesod.Static (staticFiles)
|
import Yesod.Static (staticFiles)
|
||||||
|
|
||||||
-- | This generates easy references to files in the static directory at compile time,
|
-- This generates easy references to files in the static directory at compile time,
|
||||||
-- giving you compile-time verification that referenced files exist.
|
-- giving you compile-time verification that referenced files exist.
|
||||||
-- Warning: any files added to your static directory during run-time can't be
|
-- Warning: any files added to your static directory during run-time can't be
|
||||||
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
||||||
|
--
|
||||||
|
-- For example, to refer to @static/js/script.js@ via an identifier, you'd use:
|
||||||
|
--
|
||||||
|
-- js_script_js
|
||||||
|
--
|
||||||
|
-- If the identifier is not available, you may use:
|
||||||
|
--
|
||||||
|
-- StaticFile ["js", "script.js"] []
|
||||||
staticFiles (appStaticDir compileTimeAppSettings)
|
staticFiles (appStaticDir compileTimeAppSettings)
|
||||||
|
|
||||||
{-# START_FILE app/DevelMain.hs #-}
|
{-# START_FILE app/DevelMain.hs #-}
|
||||||
@ -881,6 +893,9 @@ User-agent: *
|
|||||||
/ HomeR GET POST
|
/ HomeR GET POST
|
||||||
|
|
||||||
{-# START_FILE config/settings.yml #-}
|
{-# START_FILE config/settings.yml #-}
|
||||||
|
# Values formatted like "_env:ENV_VAR_NAME:default_value" can be overridden by the specified environment variable.
|
||||||
|
# See https://github.com/yesodweb/yesod/wiki/Configuration#overriding-configuration-values-with-environment-variables
|
||||||
|
|
||||||
static-dir: "_env:STATIC_DIR:static"
|
static-dir: "_env:STATIC_DIR:static"
|
||||||
host: "_env:HOST:*4" # any IPv4 host
|
host: "_env:HOST:*4" # any IPv4 host
|
||||||
port: "_env:PORT:3000"
|
port: "_env:PORT:3000"
|
||||||
|
|||||||
@ -145,13 +145,11 @@ appMain = do
|
|||||||
{-# START_FILE Foundation.hs #-}
|
{-# START_FILE Foundation.hs #-}
|
||||||
module Foundation where
|
module Foundation where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod
|
import Import.NoFoundation
|
||||||
import Settings
|
import Text.Hamlet (hamletFile)
|
||||||
import Settings.StaticFiles
|
import Text.Jasmine (minifym)
|
||||||
import Text.Hamlet (hamletFile)
|
import Yesod.Core.Types (Logger)
|
||||||
import Text.Jasmine (minifym)
|
import Yesod.Default.Util (addStaticContentExternal)
|
||||||
import Yesod.Core.Types (Logger)
|
|
||||||
import Yesod.Default.Util (addStaticContentExternal)
|
|
||||||
|
|
||||||
-- | The foundation datatype for your application. This can be a good place to
|
-- | The foundation datatype for your application. This can be a good place to
|
||||||
-- keep settings and values requiring initialization before your application
|
-- keep settings and values requiring initialization before your application
|
||||||
@ -319,8 +317,15 @@ module Import
|
|||||||
( module Import
|
( module Import
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod as Import
|
|
||||||
import Foundation as Import
|
import Foundation as Import
|
||||||
|
import Import.NoFoundation as Import
|
||||||
|
|
||||||
|
{-# START_FILE Import/NoFoundation.hs #-}
|
||||||
|
module Import.NoFoundation
|
||||||
|
( module Import
|
||||||
|
) where
|
||||||
|
|
||||||
|
import ClassyPrelude.Yesod as Import
|
||||||
import Settings as Import
|
import Settings as Import
|
||||||
import Settings.StaticFiles as Import
|
import Settings.StaticFiles as Import
|
||||||
import Yesod.Core.Types as Import (loggerSet)
|
import Yesod.Core.Types as Import (loggerSet)
|
||||||
@ -344,6 +349,7 @@ library
|
|||||||
exposed-modules: Application
|
exposed-modules: Application
|
||||||
Foundation
|
Foundation
|
||||||
Import
|
Import
|
||||||
|
Import.NoFoundation
|
||||||
Settings
|
Settings
|
||||||
Settings.StaticFiles
|
Settings.StaticFiles
|
||||||
Handler.Common
|
Handler.Common
|
||||||
@ -375,7 +381,6 @@ library
|
|||||||
build-depends: base >= 4 && < 5
|
build-depends: base >= 4 && < 5
|
||||||
, yesod >= 1.4.1 && < 1.5
|
, yesod >= 1.4.1 && < 1.5
|
||||||
, yesod-core >= 1.4.0 && < 1.5
|
, yesod-core >= 1.4.0 && < 1.5
|
||||||
, yesod-auth >= 1.4.0 && < 1.5
|
|
||||||
, yesod-static >= 1.4.0.3 && < 1.5
|
, yesod-static >= 1.4.0.3 && < 1.5
|
||||||
, yesod-form >= 1.4.0 && < 1.5
|
, yesod-form >= 1.4.0 && < 1.5
|
||||||
, classy-prelude >= 0.10.2
|
, classy-prelude >= 0.10.2
|
||||||
@ -584,10 +589,18 @@ module Settings.StaticFiles where
|
|||||||
import Settings (appStaticDir, compileTimeAppSettings)
|
import Settings (appStaticDir, compileTimeAppSettings)
|
||||||
import Yesod.Static (staticFiles)
|
import Yesod.Static (staticFiles)
|
||||||
|
|
||||||
-- | This generates easy references to files in the static directory at compile time,
|
-- This generates easy references to files in the static directory at compile time,
|
||||||
-- giving you compile-time verification that referenced files exist.
|
-- giving you compile-time verification that referenced files exist.
|
||||||
-- Warning: any files added to your static directory during run-time can't be
|
-- Warning: any files added to your static directory during run-time can't be
|
||||||
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
||||||
|
--
|
||||||
|
-- For example, to refer to @static/js/script.js@ via an identifier, you'd use:
|
||||||
|
--
|
||||||
|
-- js_script_js
|
||||||
|
--
|
||||||
|
-- If the identifier is not available, you may use:
|
||||||
|
--
|
||||||
|
-- StaticFile ["js", "script.js"] []
|
||||||
staticFiles (appStaticDir compileTimeAppSettings)
|
staticFiles (appStaticDir compileTimeAppSettings)
|
||||||
|
|
||||||
{-# START_FILE app/DevelMain.hs #-}
|
{-# START_FILE app/DevelMain.hs #-}
|
||||||
@ -774,6 +787,9 @@ User-agent: *
|
|||||||
/ HomeR GET POST
|
/ HomeR GET POST
|
||||||
|
|
||||||
{-# START_FILE config/settings.yml #-}
|
{-# START_FILE config/settings.yml #-}
|
||||||
|
# Values formatted like "_env:ENV_VAR_NAME:default_value" can be overridden by the specified environment variable.
|
||||||
|
# See https://github.com/yesodweb/yesod/wiki/Configuration#overriding-configuration-values-with-environment-variables
|
||||||
|
|
||||||
static-dir: "_env:STATIC_DIR:static"
|
static-dir: "_env:STATIC_DIR:static"
|
||||||
host: "_env:HOST:*4" # any IPv4 host
|
host: "_env:HOST:*4" # any IPv4 host
|
||||||
port: "_env:PORT:3000"
|
port: "_env:PORT:3000"
|
||||||
|
|||||||
@ -164,17 +164,13 @@ appMain = do
|
|||||||
{-# START_FILE Foundation.hs #-}
|
{-# START_FILE Foundation.hs #-}
|
||||||
module Foundation where
|
module Foundation where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod
|
import Import.NoFoundation
|
||||||
import Database.Persist.Sql (ConnectionPool, runSqlPool)
|
import Database.Persist.Sql (ConnectionPool, runSqlPool)
|
||||||
import Model
|
|
||||||
import Settings
|
|
||||||
import Settings.StaticFiles
|
|
||||||
import Text.Hamlet (hamletFile)
|
import Text.Hamlet (hamletFile)
|
||||||
import Text.Jasmine (minifym)
|
import Text.Jasmine (minifym)
|
||||||
import Yesod.Auth
|
|
||||||
import Yesod.Auth.BrowserId (authBrowserId)
|
import Yesod.Auth.BrowserId (authBrowserId)
|
||||||
import Yesod.Core.Types (Logger)
|
|
||||||
import Yesod.Default.Util (addStaticContentExternal)
|
import Yesod.Default.Util (addStaticContentExternal)
|
||||||
|
import Yesod.Core.Types (Logger)
|
||||||
|
|
||||||
-- | The foundation datatype for your application. This can be a good place to
|
-- | The foundation datatype for your application. This can be a good place to
|
||||||
-- keep settings and values requiring initialization before your application
|
-- keep settings and values requiring initialization before your application
|
||||||
@ -383,8 +379,15 @@ module Import
|
|||||||
( module Import
|
( module Import
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod as Import
|
|
||||||
import Foundation as Import
|
import Foundation as Import
|
||||||
|
import Import.NoFoundation as Import
|
||||||
|
|
||||||
|
{-# START_FILE Import/NoFoundation.hs #-}
|
||||||
|
module Import.NoFoundation
|
||||||
|
( module Import
|
||||||
|
) where
|
||||||
|
|
||||||
|
import ClassyPrelude.Yesod as Import
|
||||||
import Model as Import
|
import Model as Import
|
||||||
import Settings as Import
|
import Settings as Import
|
||||||
import Settings.StaticFiles as Import
|
import Settings.StaticFiles as Import
|
||||||
@ -423,6 +426,7 @@ library
|
|||||||
exposed-modules: Application
|
exposed-modules: Application
|
||||||
Foundation
|
Foundation
|
||||||
Import
|
Import
|
||||||
|
Import.NoFoundation
|
||||||
Model
|
Model
|
||||||
Settings
|
Settings
|
||||||
Settings.StaticFiles
|
Settings.StaticFiles
|
||||||
@ -676,10 +680,18 @@ module Settings.StaticFiles where
|
|||||||
import Settings (appStaticDir, compileTimeAppSettings)
|
import Settings (appStaticDir, compileTimeAppSettings)
|
||||||
import Yesod.Static (staticFiles)
|
import Yesod.Static (staticFiles)
|
||||||
|
|
||||||
-- | This generates easy references to files in the static directory at compile time,
|
-- This generates easy references to files in the static directory at compile time,
|
||||||
-- giving you compile-time verification that referenced files exist.
|
-- giving you compile-time verification that referenced files exist.
|
||||||
-- Warning: any files added to your static directory during run-time can't be
|
-- Warning: any files added to your static directory during run-time can't be
|
||||||
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
-- accessed this way. You'll have to use their FilePath or URL to access them.
|
||||||
|
--
|
||||||
|
-- For example, to refer to @static/js/script.js@ via an identifier, you'd use:
|
||||||
|
--
|
||||||
|
-- js_script_js
|
||||||
|
--
|
||||||
|
-- If the identifier is not available, you may use:
|
||||||
|
--
|
||||||
|
-- StaticFile ["js", "script.js"] []
|
||||||
staticFiles (appStaticDir compileTimeAppSettings)
|
staticFiles (appStaticDir compileTimeAppSettings)
|
||||||
|
|
||||||
{-# START_FILE app/DevelMain.hs #-}
|
{-# START_FILE app/DevelMain.hs #-}
|
||||||
@ -881,6 +893,9 @@ User-agent: *
|
|||||||
/ HomeR GET POST
|
/ HomeR GET POST
|
||||||
|
|
||||||
{-# START_FILE config/settings.yml #-}
|
{-# START_FILE config/settings.yml #-}
|
||||||
|
# Values formatted like "_env:ENV_VAR_NAME:default_value" can be overridden by the specified environment variable.
|
||||||
|
# See https://github.com/yesodweb/yesod/wiki/Configuration#overriding-configuration-values-with-environment-variables
|
||||||
|
|
||||||
static-dir: "_env:STATIC_DIR:static"
|
static-dir: "_env:STATIC_DIR:static"
|
||||||
host: "_env:HOST:*4" # any IPv4 host
|
host: "_env:HOST:*4" # any IPv4 host
|
||||||
port: "_env:PORT:3000"
|
port: "_env:PORT:3000"
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-bin
|
name: yesod-bin
|
||||||
version: 1.4.1.2
|
version: 1.4.2
|
||||||
license: MIT
|
license: MIT
|
||||||
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