Created
February 10, 2020 12:51
-
-
Save Algiras/0a71fe67a66aa3974c50a41ede454910 to your computer and use it in GitHub Desktop.
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
def run(args: List[String]): IO[ExitCode] = (for { | |
config <- loadConfigF[IO, Config] | |
userCredentialStore <- UserStore(config.users.head, config.users.tail: _*) | |
http <- httpApp(userCredentialStore) | |
res <- BlazeServerBuilder[IO] | |
.bindHttp(host = config.http.host, port = config.http.port.getOrElse(0)) | |
.withHttpApp(http) | |
.serve | |
.compile | |
.drain | |
.map(_ => ExitCode.Success) | |
} yield res).handleError(_ => ExitCode.Error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment