Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

Commit

Permalink
Fire server events on new urls, change approot, git ignore, and stack…
Browse files Browse the repository at this point in the history
… yaml (the latter to support detaching the docker container
  • Loading branch information
myShoggoth committed Jun 26, 2015
1 parent 1673945 commit c8b92cb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ config/client_session_key.aes
cabal-dev/
yesod-devel/
.cabal-sandbox
.stack-work/
cabal.sandbox.config
.DS_Store
*.swp
6 changes: 5 additions & 1 deletion Handler/Home.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ postHomeR = do
($) runDB $ do
urlId <- insert url
_ <- insert $ Vote urlId ipp
return ()
urls <- selectList [] [Desc UrlVotetotal]
votes <- selectList [VoteIp ==. ipp] [Asc VoteUrlId]
chan <- appChannel <$> getYesod
let json = object [ "urls" .= jsonUrls urls (map entityVal votes) ]
liftIO $ writeChan chan $ ServerEvent Nothing Nothing $ return $ lazyByteString $ encode json
redirect HomeR
_ -> return ()
redirect HomeR
Expand Down
2 changes: 1 addition & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
static-dir: "_env:STATIC_DIR:static"
host: "_env:HOST:*4" # any IPv4 host
port: "_env:PORT:3000"
approot: "_env:APPROOT:http://localhost:3000"
approot: "_env:APPROOT:http://dev.sym.bio:3000"
ip-from-header: "_env:IP_FROM_HEADER:false"

# Optional values with the following production defaults.
Expand Down
1 change: 1 addition & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ extra-deps: []
resolver: lts-2.14
docker:
enable: true
detach: true

0 comments on commit c8b92cb

Please sign in to comment.