Skip to content

Commit

Permalink
Modified README.md to include Spark and Spring Boot Incorporation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alvin Reyes committed Jan 18, 2017
1 parent 41ada7a commit db42895
Showing 1 changed file with 57 additions and 2 deletions.
59 changes: 57 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ Once you've imported the API. You need to register the KikBotMillServlet. To do
Alternatively, you can also load your EntryPoint class via KikBotMillLoader

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

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

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

public class KikBotEntryPoint extends KikBotMillEntry {
Expand Down Expand Up @@ -100,6 +99,62 @@ Your domain holds all the actions of your Bot.
}

The framework was designed to be flexible enough to work with other Java frameworks seamlessly.

**On Spark Java**


import static spark.Spark.*;
public class KikBot {
public static void main(String[] args) {
// called once.
KikBotMillLoader.getLoader().loadEntryPoint(new KikBotEntryPoint());
// register post (use this as webhook url on the config entrypoint);
post("/webhook", (request, response) -> {
KikBotMillLoader.getLoader().postHandler(req, resp);
});
}
}

**On Spring Boot**

@SpringBootApplication
public class KikBotConfiguration {

public static void main(String[] args) {
// call the loader inside the Hell
SpringApplication.run(KikBotConfiguration.class, args);
// and load Entry Point.
KikBotMillLoader.getLoader().loadEntryPoint(new KikBotEntryPoint());
}

}

@Controller
public class RestfulSourceController {

@Autowired
Response response;
@Autowired
Request request;
@RequestMapping(value="/webhoolurl", method=RequestMethod.POST, produces="application/json")
@ResponseBody
public void post() {
return KikBotMillLoader.getLoader().postHandler(request, response);
}

}

**<h3>Technical Details</h3>**
- Primarily Compiled in Java 1.8
- 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.

**<h3>What's currently supported</h3>**

Kik-BotMill supports this Kik Messenger Platform components:
Expand Down

0 comments on commit db42895

Please sign in to comment.