I am attempting to create a server that returns two different values from a route depending if a user has visited it before. I have the following code:
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Web.Scotty
main = do
putStrLn "Starting Server..."
scotty 3000 $ do
get "/" $ do
-- if first time
text "hello!"
-- if second time
text "hello, again!"
I have two questions: 1. How can I check if a user has requested the route before? 2. Where and how can I persist application state?