content: package com.anilallewar.microservices.portal;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
  import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
  import org.springframework.cloud.netflix.turbine.EnableTurbine;
  import org.springframework.security.config.annotation.web.builders.HttpSecurity;
  import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
  
  /**
   * The boot application class that defines the spring boot application to have
   * the following properties<br>
   * <br>
   * 
   * <ol>
   * <li>Act as a Eureka client; this behavior is provided by the
   * {@link EnableEurekaClient} annotation. The Eureka server URL is provided by
   * the external configuration provided by the config server.</li>
   * <li>No security is defined for this application since it's the client facing
   * UI application.</li>
   * <li>All the UI artifacts are stored under the <code>"public"</code> folder at
   * the root.</li>
   * </ol>
   * 
   * @author anilallewar
   *
   */
  @SpringBootApplication
  @EnableEurekaClient
  @EnableHystrixDashboard
  @EnableTurbine
  public class PortalApplication extends WebSecurityConfigurerAdapter {
  
  	public static void main(String[] args) {
  		SpringApplication.run(PortalApplication.class, args);
  	}
  
  	@Override
  	public void configure(HttpSecurity http) throws Exception {
  		// @formatter:off
  		http.logout().and().authorizeRequests().antMatchers("/**/*.html", "/", "/login","/hystrix/**","/turbine.stream").permitAll().anyRequest()
  				.authenticated();
  		// @formatter:on
  	}
  }
  