Last active
November 10, 2015 00:57
-
-
Save trane/490d926ef2df5728d0cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def consulResponse(s: Secrets): ConsulResponse = | |
ConsulResponse(...., Base64Encode(s.toJson), ...) | |
def mockConsulService(secrets: Secrets): Service[Request, Response] = { | |
new Service[Request, Response] { | |
def apply(req: Request): Future[Response] = { | |
val res = Response(Status.Ok) | |
(req.method, req.path) match { | |
case (Get, Root / "/v1/k1") => res.contentString = consulResponse(secrets).toJson | |
case (Put, path) => | |
} | |
Future.value(res) | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment