Skip to content

Instantly share code, notes, and snippets.

@co-dan
Last active December 19, 2015 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save co-dan/6015894 to your computer and use it in GitHub Desktop.
Save co-dan/6015894 to your computer and use it in GitHub Desktop.
Working on scotty-hastache
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <head>
<title></title>
</head>
<body>
<h1>Scotty, {{action}} me up!</h1>
<hr>
<address></address>
<!-- hhmts start --><!-- hhmts end -->
</body> </html>
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Text.Hastache
import Web.Scotty as S
import Web.Scotty.Hastache
main :: IO ()
main = scottyH' 3000 $ do
setTemplatesDir "/home/vagrant/dev/"
-- ^ Setting up the director with templates
get "/:word" $ do
beam <- param "word"
setH "action" $ MuVariable (beam :: String)
-- ^ "action" will be binded to the contents of 'beam'
hastache "greet.html"
@p-alik
Copy link

p-alik commented Apr 2, 2015

Replace Main.hs
import Web.Scotty as S
by
import Web.Scotty.Trans as S

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment