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

ZIO HTTP Doesn't Respect Bash Naming Style (Environment Variables) #2803

Open
khajavi opened this issue Apr 25, 2024 · 0 comments
Open

ZIO HTTP Doesn't Respect Bash Naming Style (Environment Variables) #2803

khajavi opened this issue Apr 25, 2024 · 0 comments

Comments

@khajavi
Copy link
Member

khajavi commented Apr 25, 2024

Assume I have the following ZIO HTTP App:

object MainApp extends ZIOAppDefault {
  def run =
    Server.serve(
      Routes(
        Method.GET / "hello" -> handler(Response.ok),
      ),
    ).provide(
      Server.live,
      ZLayer.fromZIO(ZIO.config(Server.Config.config)).debug)
    )
}

If of set:

export BINDING_PORT=3000

But it doesn't respect it and after debugging find out that it requires BINDING-PORT

The workaround is to map key names using Server.Config.config.mapKey(_.replace('-', '_')) which is not idiomatic.

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

1 participant