Skip to content

Commit db42895

Browse files
author
Alvin Reyes
committed
Modified README.md to include Spark and Spring Boot Incorporation
1 parent 41ada7a commit db42895

1 file changed

Lines changed: 57 additions & 2 deletions

File tree

README.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,11 @@ Once you've imported the API. You need to register the KikBotMillServlet. To do
5050
Alternatively, you can also load your EntryPoint class via KikBotMillLoader
5151

5252
// Call this upon initialization of your app (should only be called once)
53-
KikBotMillLoader.getLoader().loadEntryPoint(new KikBotEntryPoint())
53+
KikBotMillLoader.getLoader().loadEntryPoint(new KikBotEntryPoint());
5454

5555
// Call this on your callback url post handler (req = HttpRequest, Resp = HttpResponse).
5656
KikBotMillLoader.getLoader().postHandler(req, resp);
5757

58-
5958
Your KikBotEntryPoint should extends KikBotMillEntry. You need to override the kikBotEntry and define your domains and behaviours.
6059

6160
public class KikBotEntryPoint extends KikBotMillEntry {
@@ -100,6 +99,62 @@ Your domain holds all the actions of your Bot.
10099
101100
}
102101

102+
The framework was designed to be flexible enough to work with other Java frameworks seamlessly.
103+
104+
**On Spark Java**
105+
106+
107+
import static spark.Spark.*;
108+
109+
public class KikBot {
110+
public static void main(String[] args) {
111+
// called once.
112+
KikBotMillLoader.getLoader().loadEntryPoint(new KikBotEntryPoint());
113+
114+
// register post (use this as webhook url on the config entrypoint);
115+
post("/webhook", (request, response) -> {
116+
KikBotMillLoader.getLoader().postHandler(req, resp);
117+
});
118+
}
119+
}
120+
121+
**On Spring Boot**
122+
123+
@SpringBootApplication
124+
public class KikBotConfiguration {
125+
126+
public static void main(String[] args) {
127+
// call the loader inside the Hell
128+
SpringApplication.run(KikBotConfiguration.class, args);
129+
130+
// and load Entry Point.
131+
KikBotMillLoader.getLoader().loadEntryPoint(new KikBotEntryPoint());
132+
133+
}
134+
135+
}
136+
137+
@Controller
138+
public class RestfulSourceController {
139+
140+
@Autowired
141+
Response response;
142+
143+
@Autowired
144+
Request request;
145+
146+
@RequestMapping(value="/webhoolurl", method=RequestMethod.POST, produces="application/json")
147+
@ResponseBody
148+
public void post() {
149+
return KikBotMillLoader.getLoader().postHandler(request, response);
150+
}
151+
152+
}
153+
154+
**<h3>Technical Details</h3>**
155+
- Primarily Compiled in Java 1.8
156+
- Easy to create a backward compatible version (change the settings in POM.xml). No need to worry of features not being available, we made sure that our framework on Java 1.5 and above.
157+
103158
**<h3>What's currently supported</h3>**
104159

105160
Kik-BotMill supports this Kik Messenger Platform components:

0 commit comments

Comments
 (0)