Remove preceding equals
This commit is contained in:
parent
e6cf2bc659
commit
f2665335b3
14
src/API.hs
14
src/API.hs
@ -5,16 +5,16 @@
|
|||||||
{-# Language OverloadedStrings #-}
|
{-# Language OverloadedStrings #-}
|
||||||
module API where
|
module API where
|
||||||
|
|
||||||
import Servant.API
|
import Servant.API
|
||||||
import ClassyPrelude
|
import ClassyPrelude
|
||||||
|
|
||||||
import qualified API.IPFS as IPFS
|
import qualified API.IPFS as IPFS
|
||||||
|
|
||||||
import Text.Pandoc.Readers.Markdown (readMarkdown)
|
import Network.HTTP.Media ((//), (/:))
|
||||||
import Text.Pandoc.Writers.HTML (writeHtml5String)
|
import Text.Pandoc.Class (runPure)
|
||||||
import Text.Pandoc.Class (runPure, PandocMonad)
|
import Text.Pandoc.Options (def)
|
||||||
import Text.Pandoc.Options (def)
|
import Text.Pandoc.Readers.Markdown (readMarkdown)
|
||||||
import Network.HTTP.Media ((//), (/:))
|
import Text.Pandoc.Writers.HTML (writeHtml5String)
|
||||||
|
|
||||||
data HTML
|
data HTML
|
||||||
|
|
||||||
|
@ -5,12 +5,10 @@
|
|||||||
module Server.IPFS where
|
module Server.IPFS where
|
||||||
|
|
||||||
import API.IPFS
|
import API.IPFS
|
||||||
import Servant
|
import ClassyPrelude hiding (hash)
|
||||||
import ClassyPrelude
|
|
||||||
|
|
||||||
import Network.DNS
|
|
||||||
|
|
||||||
import Control.Lens (over, _Left)
|
import Control.Lens (over, _Left)
|
||||||
|
import Network.DNS
|
||||||
|
import Servant
|
||||||
|
|
||||||
handler :: Server API
|
handler :: Server API
|
||||||
handler = liftIO getHash >>= either (const (throwError err500)) return
|
handler = liftIO getHash >>= either (const (throwError err500)) return
|
||||||
@ -23,6 +21,6 @@ handler = liftIO getHash >>= either (const (throwError err500)) return
|
|||||||
-- This is terrible
|
-- This is terrible
|
||||||
return (eTxt >>= maybe (Left "Could not find dnslink") Right . hash)
|
return (eTxt >>= maybe (Left "Could not find dnslink") Right . hash)
|
||||||
hash [x] = case x of
|
hash [x] = case x of
|
||||||
(stripPrefix "dnslink" -> Just h) -> Just . VersionHash . decodeUtf8 $ h
|
(stripPrefix "dnslink=" -> Just h) -> Just . VersionHash . decodeUtf8 $ h
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
hash _ = Nothing
|
hash _ = Nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user