Snippets Collections
#second: add below to application.properties
  #Activate Spring Boot Actuator
     #management.endpoints.web.exposure.include=refresh
      management.endpoints.web.exposure.include=*
  # Sometime, endpoint refresh can be error, so, use * with higher effective
      
      // --------------------------------------------------
		 #Third: Add @refreshScope to handle service
   	 // --------------------------------------------------
 @RestController
@RequestMapping("/product")
@RefreshScope
public class ProductRestController {
   
   @Value("${app.title}")
   private String title;
 
   @GetMapping("/data")
   public ResponseEntity<String> showProductMsg() {
      return new ResponseEntity<String>("Value of title from Config Server: "+title, HttpStatus.OK);
   }
}
	@Bean
	public WebMvcConfigurer corsConfigurer() {
		return new WebMvcConfigurer() {
			@Override
			public void addCorsMappings(CorsRegistry registry) {
				registry.addMapping("/**").allowedOrigins("http://localhost:4200").allowedMethods("*").allowedHeaders("*");
			}
		};
	}
	
}
@RequestMapping(produces = [MediaType.TEXT_HTML_VALUE, CustomMediaType.TURBO_STREAM_VALUE])
suspend fun pinger(model: Model): String {
    model.addAttribute("pingTime", pingService.ping(hostname, port))
    return "ping.turbo-stream"
}
star

Tue Nov 22 2022 15:12:36 GMT+0000 (UTC)

#springframework
star

Thu Dec 23 2021 09:43:06 GMT+0000 (UTC) https://www.facebook.com/profile.php?id=100010247581084

#springframework
star

Wed Oct 20 2021 02:01:31 GMT+0000 (UTC) https://yoandroide.xyz/configuracion-de-cors-en-un-proyecto-spring-boot/

#springframework #spring #boot
star

Wed Jun 23 2021 05:25:12 GMT+0000 (UTC) undefined

#springframework
star

Mon Jan 18 2021 05:24:39 GMT+0000 (UTC)

#kotlin #springframework

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension