diff options
| author | LLLL Colonq <llll@colonq> | 2024-01-23 18:07:19 -0500 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-01-23 18:07:19 -0500 |
| commit | a8036ceb91c1e1f5ea74f8cf23666e892f9cd051 (patch) | |
| tree | 14d21f3fd10b21979f44684ee1e87c2c9ed6cb79 /fig-frontend/src/Fig/Frontend.hs | |
| parent | 4a7ab38bf416fc5eb6f7602cc97146f9b06ec627 (diff) | |
Add get song notes endpoint
Diffstat (limited to 'fig-frontend/src/Fig/Frontend.hs')
| -rw-r--r-- | fig-frontend/src/Fig/Frontend.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fig-frontend/src/Fig/Frontend.hs b/fig-frontend/src/Fig/Frontend.hs index 95ab28b..3cab953 100644 --- a/fig-frontend/src/Fig/Frontend.hs +++ b/fig-frontend/src/Fig/Frontend.hs @@ -60,4 +60,9 @@ app cfg = do DB.hvals db "songnames" >>= \case Nothing -> Tw.send . Tw.status Tw.status404 $ Tw.text "no sounds found :(" Just songs -> Tw.send . Tw.text . pretty . SExprList @Void $ SExprString . decodeUtf8 <$> songs + , Tw.get "/api/song/:hash" do + hash <- Tw.param "hash" + DB.hget db "songnotes" hash >>= \case + Nothing -> Tw.send . Tw.status Tw.status404 $ Tw.text "song not found" + Just val -> Tw.send . Tw.text $ decodeUtf8 val ] |
