Skip to content

Commit

Permalink
Merge pull request #3545 from SentryMan/inject-environment
Browse files Browse the repository at this point in the history
Add `Environment` to Avaje `BeanScope`
  • Loading branch information
jknack authored Sep 29, 2024
2 parents 6ad5084 + bcf7537 commit a8501b3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import edu.umd.cs.findbugs.annotations.NonNull;
import io.avaje.inject.BeanScope;
import io.avaje.inject.BeanScopeBuilder;
import io.jooby.Environment;
import io.jooby.Extension;
import io.jooby.Jooby;

Expand Down Expand Up @@ -75,6 +76,8 @@ public void install(Jooby application) {
});

final var environment = application.getEnvironment();

beanScope.bean(Environment.class, environment);
beanScope.profiles(environment.getActiveNames().toArray(String[]::new));

// configuration properties
Expand Down

0 comments on commit a8501b3

Please sign in to comment.