-
Add
/rsa/
directory inside/echo/
. The .pem files live inside thersa
dir -
Install Dependencies
$ cd echo
$ npm i
- Configure Then setup a new .env file with the following properties:
BOT_PATH=./rsa/
BOT_NAME=
BOT_PASSWORD=
BOT_PRIVATE_KEY_PATH=./rsa/
BOT_PRIVATE_KEY_NAME=
BOT_USERNAME=
BOT_EMAIL_ADDRESS=
- Start
$ npm start
####Query for an answer:
curl "http://localhost:3000/answer?question=Why%20is%20the%20sky%20blue%3F"
response (200):
{"key":"life.facts", "question":"Why is the sky blue?","answer":"I dont know"}
####Save a question/answer pair:
curl -d '{"key":"life.facts", "question":"Why is the sky blue?", "answer":"I dont know"}' -H "Content-Type: application/json" -X POST http://localhost:3000/save
response (201):
{"message":"saved!"}
node: v10.13.0 npm: 4.6.1
npm install -g yo
npm install -g generator-symphony --cli
https://developers.symphony.com/symphony-developer/docs/symphony-generator
mkdir mybotapp
cd mybotapp
yo symphony
This was also a good reference: https://developers.symphony.com/symphony-developer/docs/creating-a-room-provisioning-bot-using-nodejs