From 932845c464cf514dc676b2bcef465d3c82501fe9 Mon Sep 17 00:00:00 2001 From: Merton Date: Thu, 4 May 2017 21:29:23 +0100 Subject: [PATCH] Fixed bug that caused a runtime error when trying to view non-exisitant records --- Settings/StaticFiles.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Settings/StaticFiles.hs diff --git a/Settings/StaticFiles.hs b/Settings/StaticFiles.hs new file mode 100644 index 0000000..c8021d3 --- /dev/null +++ b/Settings/StaticFiles.hs @@ -0,0 +1,18 @@ +module Settings.StaticFiles where + +import Settings (appStaticDir, compileTimeAppSettings) +import Yesod.Static (staticFiles) + +-- This generates easy references to files in the static directory at compile time, +-- giving you compile-time verification that referenced files exist. +-- 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. +-- +-- 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)