From 61e21346a6947327bf5394f6c73499621c494986 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 10 Apr 2020 16:33:00 -0700 Subject: Deploy herocomics.app production server This also includes some drive-by formatting changes and config changes needed to get it up and running. --- Com/MusicMeetsComics/Database.hs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'Com/MusicMeetsComics/Database.hs') diff --git a/Com/MusicMeetsComics/Database.hs b/Com/MusicMeetsComics/Database.hs index 8178e9a..c5a0068 100644 --- a/Com/MusicMeetsComics/Database.hs +++ b/Com/MusicMeetsComics/Database.hs @@ -3,18 +3,19 @@ {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Com.MusicMeetsComics.Database - ( - ComicDB + ( ComicDB , getComics , load - ) where + , dummy + ) +where import Com.MusicMeetsComics.App -import Data.Map ( Map ) -import qualified Data.Map as Map +import Data.Map ( Map ) +import qualified Data.Map as Map import Dhall import Protolude -import Servant ( Handler ) +import Servant ( Handler ) type ComicDB = (Map ComicId Comic) @@ -23,6 +24,16 @@ instance Interpret Comic load :: IO ComicDB load = listToComicDB <$> input auto "./comic-database.dhall" +dummy :: IO ComicDB +dummy = return $ listToComicDB + [ Comic { comicId = "ComicId" + , comicPages = 10 + , comicName = "Dummy comic" + , comicIssue = "dummy issue" + , comicDescription = "Lorem ipsum" + } + ] + listToComicDB :: [Comic] -> ComicDB listToComicDB ls = Map.fromList $ (,) <$> comicId <*> identity <$> ls -- cgit v1.2.3