Move Accept HTML in Yore.Servant
This commit is contained in:
+2
-9
@@ -19,12 +19,10 @@ import Data.Proxy (Proxy (..))
|
||||
import Data.Text (Text)
|
||||
import Data.Time (Day, LocalTime (..), TimeOfDay (..), ZonedTime (..), addDays, toGregorian)
|
||||
import GHC.Generics (Generic)
|
||||
import Network.HTTP.Media ((//), (/:))
|
||||
import Network.HTTP.Types (Status (..))
|
||||
import Network.Wai (Request (..))
|
||||
import Servant
|
||||
( Accept (..)
|
||||
, Capture
|
||||
( Capture
|
||||
, Get
|
||||
, Handler
|
||||
, MimeRender (..)
|
||||
@@ -59,7 +57,7 @@ import Yore.Download (downloadInto)
|
||||
import Yore.Error (Error (..))
|
||||
import Yore.Schedule (schedule)
|
||||
import Yore.Scrape (Issue (..), getIssuesByDay)
|
||||
import Yore.Servant (GetSendfile, Sendfile (..))
|
||||
import Yore.Servant (GetSendfile, HTML, Sendfile (..))
|
||||
import Yore.Time (addYears, getCurrentDay, getSecondsUntilMidnight)
|
||||
|
||||
import qualified Envy
|
||||
@@ -232,11 +230,6 @@ instance MimeRender HTML RootModel where
|
||||
|
||||
-- Utils
|
||||
|
||||
data HTML
|
||||
|
||||
instance Accept HTML where
|
||||
contentType _ = "text" // "html" /: ("charset", "utf-8")
|
||||
|
||||
get100YearsAgo :: IO (Either Error Day)
|
||||
get100YearsAgo = runExceptT $ getTodayWithOffset (-100) 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user