Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val routes = {
- logRequestResult("microservice") {
- path("test") {
- (post) {
- complete {
- find().map { v =>
- var info = convertToJson(v)
- HttpResponse(entity = HttpEntity(ContentType(MediaTypes.`application/json`), info.getOrElse(Json.obj()).toString))
- }
- }
- }
- }
- }
- }
- def find()(implicit ec: ExecutionContext): Future[Option[Details]] = {
- collection.find(BSONDocument()).one[Details]
Add Comment
Please, Sign In to add comment