Skip to content

Commit

Permalink
Fix ordering so middlewares run before routes!
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Farmer committed Jan 3, 2012
1 parent 5b208c5 commit a3e1bf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Web/Spock.hs
Expand Up @@ -62,7 +62,7 @@ spock p s = putStrLn "Setting phasers to stun... (ctrl-c to quit)" >> (run p =<<
spockApp :: SpockM () -> IO Application
spockApp defs = do
s <- MS.execStateT (runS defs) def
return $ foldl (flip ($)) notFoundApp $ middlewares s ++ routes s
return $ foldl (flip ($)) notFoundApp $ routes s ++ middlewares s

notFoundApp :: Application
notFoundApp _ = return $ ResponseBuilder status404 [("Content-Type","text/html")]
Expand Down

0 comments on commit a3e1bf9

Please sign in to comment.