diff --git a/src/Application.hs b/src/Application.hs index 80136ac..8253924 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -25,13 +25,13 @@ app runner = do (baseUrl,_) <- serverSettings table <- records - cssPath <- getDataFileName "layouts/main.css" - indexPath <- getDataFileName "views/index.html" - donePath <- getDataFileName "views/done.html" + css <- getDataFileName "layouts/main.css" + index <- getDataFileName "views/index.html" + done <- getDataFileName "views/done.html" runner $ controllerApp settings $ do - get "/" (render indexPath ()) - get "/main.css" (serveStatic cssPath) + get "/" (render index ()) + get "/main.css" (serveStatic css) get "/:word" $ do word <- queryParam' "word" @@ -48,5 +48,5 @@ app runner = do Just url -> do word <- liftIO (insert table url) logStr (printf "Registered %s -> %s " url word) - render donePath $ object ["link" .= (baseUrl ++ word)] + render done $ object ["link" .= (bindUrl ++ word)] Nothing -> respond badRequest