I have this basic Spock application taken from its website:
main :: IO ()
main =
do ref <- newIORef 0
spockCfg <- defaultSpockCfg EmptySession PCNoDatabase (DummyAppState ref)
runSpock 8080 (spock spockCfg app)
app :: SpockM () MySession MyAppState ()
app =
do get root $
text "Hello World!"
get -- ??? route for "/img/"???
I have an html page which I can return like this:
However, an html page contains a some "img" tags. How do I need to create a route so that the images resolves? Say, the images are location in the folder "img".
Something I like to do is to use the
wai-middleware-static
middleware to serve a static directory :