summaryrefslogtreecommitdiff
path: root/fig-web/src/Fig/Web/Module/Shader.hs
blob: a0773a780b2c9284c8b422f9c998c7c3649c248f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Fig.Web.Module.Shader
  ( public
  ) where

import Fig.Prelude

import Fig.Web.Utils
import Fig.Web.Types
import qualified Fig.Utils.DB as DB

public :: PublicModule
public a = do
  onGet "/api/shader" do
    DB.run a.db (DB.get "shader") >>= \case
      Nothing -> do
        status status404
        respondText "no shader present"
      Just sh -> respondText $ decodeUtf8 sh