summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/src/Minilang/API.hs
diff options
context:
space:
mode:
authorArnaud Bailly <arnaud@pankzsoft.com>2025-11-05 08:24:05 +0100
committerArnaud Bailly <arnaud@pankzsoft.com>2025-11-05 08:24:05 +0100
commit246d370bd903edeb5570b6f016556528b8ca57fc (patch)
tree0ce7b42c2644d1ea65b3284533666606ccc6fa61 /lambda-calcul/haskell/src/Minilang/API.hs
parentabd07940e50d4b86024410971fc2c4dff058fd48 (diff)
downloadlambda-nantes-246d370bd903edeb5570b6f016556528b8ca57fc.tar.gz
can cleanup registered users
Diffstat (limited to 'lambda-calcul/haskell/src/Minilang/API.hs')
-rw-r--r--lambda-calcul/haskell/src/Minilang/API.hs19
1 files changed, 18 insertions, 1 deletions
diff --git a/lambda-calcul/haskell/src/Minilang/API.hs b/lambda-calcul/haskell/src/Minilang/API.hs
index 8082ac8..94976d2 100644
--- a/lambda-calcul/haskell/src/Minilang/API.hs
+++ b/lambda-calcul/haskell/src/Minilang/API.hs
@@ -16,11 +16,28 @@ import qualified Data.ByteString.Lazy as LBS
import Data.Text (Text)
import Data.Time (UTCTime)
import GHC.Generics (Generic)
-import Servant (FromHttpApiData, Get, JSON, Post, QueryParam, Raw, ReqBody, StdMethod (POST), ToHttpApiData, Verb, parseUrlPiece, toUrlPiece, (:<|>), (:>))
+import Servant
+ ( Delete,
+ FromHttpApiData,
+ Get,
+ JSON,
+ Post,
+ QueryParam,
+ Raw,
+ ReqBody,
+ StdMethod (POST),
+ ToHttpApiData,
+ Verb,
+ parseUrlPiece,
+ toUrlPiece,
+ (:<|>),
+ (:>),
+ )
import System.Random (StdGen, uniformList)
type LambdaAPI =
"api" :> "register" :> ReqBody '[JSON] User :> Verb 'POST 201 '[JSON] Token
+ :<|> "api" :> "register" :> QueryParam "token" Token :> Delete '[JSON] Score
:<|> "api" :> "leaderboard" :> Get '[JSON] [Score]
:<|> "api" :> "score" :> QueryParam "token" Token :> Get '[JSON] Score
:<|> "api" :> "challenge" :> QueryParam "token" Token :> Get '[JSON] Challenge