As first step we implement a route. Microservices can be used to subscribe to the main application by telling where they are and which intent they can serve.
- [Instructor] We will now refactor our main application…and add a service registry to make it resilient.…For that, we open the IRIS application in there service.js.…Let's implement the route or services…we'll use to announce themselves.…So here right after we declare service,…I add service.gat, and the route should be…/service/:intent/:port…and the callback should be a function that gets…a request, a response, and a next function,…and in the function body we will add…const serviceIntent = req.params.intent;…So this is the first param we get here,…and next we will store the port we just got in…const servicePort = req.params.port;…The IP the service listens at…can be taken from the request headers.…
There are scenarios where such requests…are routed through proxy servers…but for simplicity reasons we assume…that all services can be directly reached here.…And on some systems the remote address will be…in IPv6 notation, and this changes the way…we have to connect to it.…That's why we have to put a little check in here,…
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