package com.persagy.cameractl.conf;

import org.springframework.stereotype.Component;
import org.springframework.beans.factory.annotation.Value;

@Component
public class ServerConfig {
	 @Value("${server.port}")
	 private int serverPort;
	 @Value("${server.servlet.context-path}")
	 private String contextPath;
	 
	 public String getUrl() {
//        InetAddress address = null;
//        try {
//            address = InetAddress.getLocalHost();
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        return address.getHostAddress() +":"+this.serverPort+this.contextPath;
		 return this.serverPort+this.contextPath;
    }
}
