We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eca7c7f commit ed38654Copy full SHA for ed38654
1 file changed
rentplace/src/main/java/kattsyn/dev/rentplace/configs/OpenRouterConfig.java
@@ -0,0 +1,21 @@
1
+package kattsyn.dev.rentplace.configs;
2
+
3
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
4
+import org.springframework.context.annotation.Bean;
5
+import org.springframework.context.annotation.Configuration;
6
+import org.springframework.http.HttpHeaders;
7
+import org.springframework.web.reactive.function.client.WebClient;
8
9
+@Configuration
10
+@EnableConfigurationProperties(OpenRouterProperties.class)
11
+public class OpenRouterConfig {
12
13
+ @Bean
14
+ public WebClient webClient(OpenRouterProperties props) {
15
+ return WebClient.builder()
16
+ .baseUrl(props.url())
17
+ .defaultHeader(HttpHeaders.AUTHORIZATION, "Bearer " + props.key())
18
+ .build();
19
+ }
20
21
+}
0 commit comments