gdritter repos unalaq / master src / Main.hs
master

Tree @master (Download .tar.gz)

Main.hs @master

bc854a6
 
 
b30d36d
 
bc854a6
b30d36d
 
bc854a6
 
b30d36d
 
 
 
 
 
 
 
{-# LANGUAGE OverloadedStrings #-}
module Main where

import           Control.Monad.IO.Class (liftIO)
import           Web.Scotty

import qualified Template
import qualified Storage

main :: IO ()
main = scotty 3000 $ do
  get "/" $ do
    page <- liftIO (Template.paneList `fmap` Storage.getPanes)
    html page
  get "/chunk/:n" $ do
    n <- param "n"
    let offset = 0x100000 + (n * 0xff)
    html (Template.charList offset n)