Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http4s - launch custom BlazeServerBuilder #924

Open
tampler opened this issue May 30, 2020 · 1 comment
Open

http4s - launch custom BlazeServerBuilder #924

tampler opened this issue May 30, 2020 · 1 comment

Comments

@tampler
Copy link

tampler commented May 30, 2020

Hello
I'd like to run a custom http4s server, say from http4s doc page

object Main extends IOApp {

  val helloWorldService = HttpRoutes.of[IO] {
    case GET -> Root / "hello" / name =>
      Ok(s"Hello, $name.")
  }.orNotFound

  def run(args: List[String]): IO[ExitCode] =
    BlazeServerBuilder[IO](global)
      .bindHttp(8080, "localhost")
      .withHttpApp(helloWorldService)
      .serve
      .compile
      .drain
      .as(ExitCode.Success)
}

How can I do that with Mu API ?

Thanks !

@cb372
Copy link
Member

cb372 commented Jun 1, 2020

I'm not sure I understand your question correctly, but have you seen the petstore4s example repo? That repo has an http4s client and server built with Mu, with the client code generated from an OpenAPI spec. Does that help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants