Skip to content

Instantly share code, notes, and snippets.

@kmikulski
Created December 5, 2018 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmikulski/272f5c86c519b0cd19ce92a28ff4d64c to your computer and use it in GitHub Desktop.
Save kmikulski/272f5c86c519b0cd19ce92a28ff4d64c to your computer and use it in GitHub Desktop.
the description for this gist
object QuickstartServer extends App with UserRoutes with CORSHandler {
implicit def rejectionHandler: RejectionHandler = RejectionHandler.newBuilder().handle {
case AuthorizationFailedRejection => complete(StatusCodes.Unauthorized -> None)
}.result().mapRejectionResponse(addCORSHeaders)
lazy val routes: Route = corsHandler(userRoutes)
// rest of the boilerplate here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment