Configuration
ChatBot configurations
The sample project you just ran comes with default configurations. A lot of configurations can be overridden too but for simplicity only these are used in the sample project.
resources:
templates: ..full/path/to/templates/dir
triggers: ..full/path/to/triggers/dir
watcher: ..full/path/to/watch/dir
hooks:
base-url: "http://localhost:${server.port}${server.servlet.context-path}"
security-token: "hook-url-auth-token"
chatbot:
configs:
initial-stage: "START-MENU"
session-ttl: 30
hub-token: "replace-with-your-hub-token"
access-token: "replace-with-your-access-token"
phone-number-id: "replace-with-your-phone-number-id"
server:
servlet:
context-path: /jawce
port: 8080
Resources
The resources section defines where to find the templates and triggers.
Configure the full path to where the resources are, for example. If you clone the project in C:\\Projects
folder, it will be like below
resources:
templates: C:\\Projects\\jawce\\example\\jchatbot\\src\\main\\resources\\templates
triggers: C:\\Projects\\jawce\\example\\jchatbot\\src\\main\\resources\\triggers
watcher: C:\\Projects\\jawce\\example\\jchatbot\\src\\main\\resources\\watch
The watcher
is used to listen to file changes in the watch
dir which will trigger all templates to reload without restarting the service.
The hooks
is a powerful feature which enables the engine to make request calls to external service where your chatbot logic sits (usually your local running server).
The security-token
is a security credential to send in your hook requests. This can be for a secured hook endpoint using JWT, Bearer Token or any security
token you implement.