Skip to content

Commit

Permalink
POST /waves/address refactored to use postJsonRoute
Browse files Browse the repository at this point in the history
  • Loading branch information
gagarin55 committed Jul 19, 2016
1 parent 47b8325 commit 3b52c03
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/scala/scorex/waves/http/WavesApiRoute.scala
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@ case class WavesApiRoute(override val application: Application)(implicit val con
path("address") {
withCors {
entity(as[String]) { publicKey =>
val addressFromPubKey = Account.fromPublicKey(Base58.decode(publicKey).get)
complete(HttpEntity(ContentTypes.`application/json`, Json.obj("address" -> addressFromPubKey).toString))
postJsonRoute {
val addressFromPubKey = Account.fromPublicKey(Base58.decode(publicKey).get)
JsonResponse(Json.obj("address" -> addressFromPubKey), StatusCodes.OK)
}
}
}
}
Expand Down

0 comments on commit 3b52c03

Please sign in to comment.