<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="
 http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
         http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd">

  <context:component-scan base-package="com.paytm.demo"/>

  <mvc:annotation-driven/>

  <!-- Let Tomcat DefaultServlet serve static files (e.g. index.html) when no @Controller matches -->
  <mvc:default-servlet-handler/>

  <mvc:cors>
    <mvc:mapping path="/**" allowed-origin-patterns="*" allowed-methods="GET,POST,OPTIONS" allowed-headers="*"/>
  </mvc:cors>

  <bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
    <constructor-arg>
      <bean class="org.springframework.http.client.HttpComponentsClientHttpRequestFactory"/>
    </constructor-arg>
  </bean>
</beans>
