Commit 38a921c1 authored by Christopher Cottier's avatar Christopher Cottier

refactored app configuration to read external service urls from application properties

parent 3cdd2228
package com.nisum.ecomservice.config;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
@NoArgsConstructor
public class AppConfig {
@Autowired
private static Environment env;
private static String orderManagementUrl=env.getProperty("orders.apiUrl");
private static String productsManagementUrl=env.getProperty("products.apiUrl");
private static String promoManagementUrl=env.getProperty("promos.apiUrl");
public static String getOrderManagementUrl() {
return orderManagementUrl;
}
public static String getProductsManagementUrl() {
return productsManagementUrl;
}
public static String getPromoManagementUrl() {
return promoManagementUrl;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment