Created
December 5, 2018 21:30
-
-
Save kmikulski/272f5c86c519b0cd19ce92a28ff4d64c to your computer and use it in GitHub Desktop.
the description for this gist
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
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