Add logout endpoint.

This commit is contained in:
Dillon Kearns 2021-12-22 21:29:10 -08:00
parent 0501b4da4b
commit 146240c3dd

View File

@ -24,6 +24,7 @@ routes getStaticRoutes htmlToString =
, serverRequestInfo
, repoStars
, repoStars2
, logout
]
@ -120,6 +121,21 @@ nonHybridRoute =
)
logout : ApiRoute ApiRoute.Response
logout =
ApiRoute.succeed
(\isAvailable ->
DataSource.succeed
(ServerResponse.stringBody "You are logged out"
|> ServerResponse.withHeader "Set-Cookie" "username=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT"
)
)
|> ApiRoute.literal "api"
|> ApiRoute.slash
|> ApiRoute.literal "logout"
|> ApiRoute.serverless
repoStars : ApiRoute ApiRoute.Response
repoStars =
ApiRoute.succeed