@@ -18,8 +18,8 @@ import Servant.Server (BasicAuthCheck (BasicAuthCheck),
1818 BasicAuthResult( Authorized
1919 , Unauthorized
2020 ),
21− Config ((:.), EmptyConfig), Server,
22− serveWithConfig)
21+ Context ((:.), EmptyContext), Server,
22+ serveWithContext)
2323
2424-- | let's define some types that our API returns.
2525
@@ -62,12 +62,12 @@ authCheck =
6262 else return Unauthorized
6363 in BasicAuthCheck check
6464
65−-- | We need to supply our handlers with the right configuration. In this case,
66−-- Basic Authentication requires a Config Entry with the 'BasicAuthCheck' value
67−-- tagged with "foo-tag" This config is then supplied to 'server' and threaded
65+-- | We need to supply our handlers with the right Context. In this case,
66+-- Basic Authentication requires a Context Entry with the 'BasicAuthCheck' value
67+-- tagged with "foo-tag" This context is then supplied to 'server' and threaded
6868-- to the BasicAuth HasServer handlers.
69−serverConfig :: Config (BasicAuthCheck User ': '[])
70−serverConfig = authCheck :. EmptyConfig
69+serverContext :: Context (BasicAuthCheck User ': '[])
70+serverContext = authCheck :. EmptyContext
7171
7272-- | an implementation of our server. Here is where we pass all the handlers to our endpoints.
7373-- In particular, for the BasicAuth protected handler, we need to supply a function
@@ -80,7 +80,7 @@ server =
8080
8181-- | hello, server!
8282main :: IO ()
83−main = run 8080 (serveWithConfig api serverConfig server)
83+main = run 8080 (serveWithContext api serverContext server)
8484
8585{- Sample session
8686