Class WebClientConfig
java.lang.Object
gr.unipi.weather_app.configuration.WebClientConfig
Configuration class for setting up a
WebClient
bean.
This class is responsible for creating a WebClient
instance
that will be used to make HTTP requests to the weather API.
The base URL for the API is injected from the application's properties.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.reactive.function.client.WebClient
Creates and configures aWebClient
bean.
-
Field Details
-
baseUrl
The base URL for the weather API, injected from application properties.
-
-
Constructor Details
-
WebClientConfig
public WebClientConfig()
-
-
Method Details
-
webClient
@Bean public org.springframework.web.reactive.function.client.WebClient webClient()Creates and configures aWebClient
bean.This WebClient instance is built using the provided base URL and can be used throughout the application for making asynchronous HTTP requests.
- Returns:
- a configured
WebClient
instance
-