I'm currently working with Telegram bots and seem like some telegram bots could be served at one endpoint due to lack of information in bot's message to separate one bot's message from another one. New bots can appear during runtime, so I can not hardcode some separate endpoints for every bot. So there is it possible to create a new endpoint by template in spring boot in runtime?
Advantages of using Spring BootIt allows you to create REST APIs with minimal configurations. A few benefits of using Spring Boot for your REST APIs include: No requirement for complex XML configurations. Embedded Tomcat server to run Spring Boot applications.
To enable Spring Boot actuator endpoints to your Spring Boot application, we need to add the Spring Boot Starter actuator dependency in our build configuration file. Maven users can add the below dependency in your pom. xml file.
No Spring Boot isn't just for REST APIs. Spring Boot is "just" a mechanism for autoconfiguring a Spring Framework based application. Therefore you can use and it does get used for all kinds of stuff.
No. The DispatcherServlet is initialized in an ApplicationContext thats a child context of your root context, so you can't access it.
One way to have a "dynamic" endpoint is to use wildcards in the Request mapping.
@RequestMapping(value="/results/**", method=RequestMethod.GET)
public SomeResult handleResults(HttpServletRequest request) {
String path = request. getRequestURI();
if("asd".equals(path)){...}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With