Use shorter names
This commit is contained in:
parent
1a125265ab
commit
bded0fb6bd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user