To show how easily new services can be added, we will go through the process of adding a service that gives us the weather for any given location.
- [Instructor] During this chapter…we created a resilient and extendable…microservice architecture.…Currently we only have one market service…which is not too exciting.…To give you an example, I've created a new service…that will give us the weather for a given location.…You'll find it in the exercise files.…Let's work through the steps to create it.…First, I copied iris-time and called it iris-weather.…I changed iris-time to iris-weather in package.json…as well,…and also changed the intent sent in run.js here,…so that we announce ourselves as service…that deals with weather instead of time.…
And to get the current metadata,…I used a service called OpenWeatherMap,…which similar to Google,…also required me to get an API key.…I reviewed the API and implemented the first test request…in service.js to see what I get back,…and with this information I was able to craft…a proper response to send to Iris when passed in a location.…So this is what I did here.…And here I'm sending back the current weather.…In Iris, I simply copied the time intent…
After explaining some basics about Node.js and microservices, Daniel shows you how to sketch out the planned architecture for your application and get the boilerplate code, modules, and credentials in place. Next, he shows how to create a bot user in Slack, connect to Slack, and post messages. He also shows you how to get your bot to process variations in text by creating logic that delegates the processing of intent to dedicated modules. Lastly, he shows how to register additional services and he covers how to use monitoring to identify architectural or performance issues.
- Using Slack APIs
- Sketching out a Slack bot architecture
- Setting up a project and choosing modules
- Creating and naming your bot
- Connecting to Slack
- Setting up and using natural language processing
- Routing by intents
- Implementing geocoding and time calculation
- Adding and monitoring services