This sample app demonstrates how to use the circuit breaker pattern to fail over Watson Assistant requests from one region to another.
See Building a multi-region IBM Watson Assistant application for details.
-
Install dependencies
npm install
-
Update config.json with proper values for your Watson Assistant instance
-
Start the application
npm start
-
Send messages to Watson Assistant via a POST request
curl -X POST \ http://localhost:3000/message \ -H 'Content-Type: application/json' \ -d '{ "text": "hello", "context": {} }'
-
For subsequent requests, use the
context
from the previous response.