Use shorter names
This commit is contained in:
parent
1a125265ab
commit
bded0fb6bd
@ -25,13 +25,13 @@ app runner = do
|
|||||||
(baseUrl,_) <- serverSettings
|
(baseUrl,_) <- serverSettings
|
||||||
table <- records
|
table <- records
|
||||||
|
|
||||||
cssPath <- getDataFileName "layouts/main.css"
|
css <- getDataFileName "layouts/main.css"
|
||||||
indexPath <- getDataFileName "views/index.html"
|
index <- getDataFileName "views/index.html"
|
||||||
donePath <- getDataFileName "views/done.html"
|
done <- getDataFileName "views/done.html"
|
||||||
|
|
||||||
runner $ controllerApp settings $ do
|
runner $ controllerApp settings $ do
|
||||||
get "/" (render indexPath ())
|
get "/" (render index ())
|
||||||
get "/main.css" (serveStatic cssPath)
|
get "/main.css" (serveStatic css)
|
||||||
|
|
||||||
get "/:word" $ do
|
get "/:word" $ do
|
||||||
word <- queryParam' "word"
|
word <- queryParam' "word"
|
||||||
@ -48,5 +48,5 @@ app runner = do
|
|||||||
Just url -> do
|
Just url -> do
|
||||||
word <- liftIO (insert table url)
|
word <- liftIO (insert table url)
|
||||||
logStr (printf "Registered %s -> %s " url word)
|
logStr (printf "Registered %s -> %s " url word)
|
||||||
render donePath $ object ["link" .= (baseUrl ++ word)]
|
render done $ object ["link" .= (bindUrl ++ word)]
|
||||||
Nothing -> respond badRequest
|
Nothing -> respond badRequest
|
||||||
|
Loading…
Reference in New Issue
Block a user