Permalink
Browse files

fayServe text/javascript. Reverted example devel.cfg to dev settings

  • Loading branch information...
1 parent 7b6245c commit 7941c27daf3604c5468012c7bf5bd252c385359a @bergmark bergmark committed Sep 2, 2012
Showing with 5 additions and 4 deletions.
  1. +2 −2 example/snaplets/fay/devel.cfg
  2. +0 −1 example/snaplets/fay/src/Index.hs
  3. +3 −1 src/Snap/Snaplet/Fay.hs
@@ -4,14 +4,14 @@
#
# Both methods will write files to disk for debugging purposes.
# Default is "Development".
-compileMode = "Production"
+compileMode = "Development"
# Print more or less information about what the snaplet is doing.
# Default is on.
verbose = on
# Run js-beautify on the results if it is available in the PATH.
# If it isn't available the compiled file will be used as is.
# Default is on.
-prettyPrint = off
+prettyPrint = on
# A comma-separated list of directories to look for fay imports in.
# This is useful if you want to share modules between Fay and Snap.
# Paths are relative to the root of the snap application.
@@ -49,7 +49,6 @@ loginOnload = formOnload "#viewLoginForm" requestLoginHtml
requestHtml :: String -> Fay () -> Fay ()ick
requestHtml url submitAction = do
- printS "requestHtml"
formContainer <- select "#formContainer"
hide "slow" formContainer
ajaxHtml url $ \h -> void $ do
View
@@ -92,7 +92,9 @@ initFay = makeSnaplet "fay" description datadir $ do
-- | Serves the compiled Fay scripts using the chosen compile mode.
fayServe :: Handler b Fay ()
-fayServe = get >>= compileWithMode . compileMode
+fayServe = do
+ modifyResponse . setContentType $ "text/javascript;charset=utf-8"
+ get >>= compileWithMode . compileMode
-- | Send and receive JSON.
-- | Automatically decodes a JSON request into a Fay record which is

0 comments on commit 7941c27

Please sign in to comment.