BotMill / fb-botmill

A Java framework for building bots on Facebook's Messenger Platform.
MIT License
72 stars 26 forks source link

Introduce a SparkJava context #26

Closed alvin-reyes closed 7 years ago

alvin-reyes commented 7 years ago

We need to introduce a SparkJava context to handle the get and post callbacks. This will be an alternative for developers that doesn't want to use web.xml/xml or servlet configuration.

aurasphere commented 7 years ago

I've looked into this and I'm thinking that this would not apport any real enhancement on the framework. Here's why:

<filter>
    <filter-name>SparkFilter</filter-name>
    <filter-class>spark.servlet.SparkFilter</filter-class>
    <init-param>
        <param-name>applicationClass</param-name>
        <param-value>com.company.YourApplication</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>SparkFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

so you will still need a web.xml that's actually more complex than the default servlet configuration.

This is the same for Spring Boot. I think that the strength of both of these frameworks is that they let you quickly deploy your app using a main class, but since here we are working with webhooks, you probably don't need it and you will almost always use a web service with an exposed IP. This is my opinion though and I'm open to other point of views. Until then, I'm marking this and Spring Boot as won't fix.