Skip to content

Instantly share code, notes, and snippets.

@lforite
Created December 11, 2019 09:23
Show Gist options
  • Select an option

  • Save lforite/36a87f7ccc6d7cd1ef062522b2ae7052 to your computer and use it in GitHub Desktop.

Select an option

Save lforite/36a87f7ccc6d7cd1ef062522b2ae7052 to your computer and use it in GitHub Desktop.
case class ApiA(serviceA: ServiceA) {
def postA() = Route { request =>
val correlationId = request.headers("X-Correlation-Id")
.map(CorrelationId)
.getOrElse(CorrelationId.new)
serviceA.createA(request.body.decodeJson[EntityA])
.run(correlationId)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment