From the course: Building Bots with Node.js

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Preparing to add threaded sesssions

Preparing to add threaded sesssions - Node.js Tutorial

From the course: Building Bots with Node.js

Start my 1-month free trial

Preparing to add threaded sesssions

- [Instructor] In this video, we will real quick add the SessionService we just created, and we will also create the function that helps us generating a session in a deterministic way. So, I will first go into app.js, and, as we did it before, I'm bringing in the service we just created. const SessionService = require('./services/SessionService'); Then, further down, where we also created all the other services, I add const SessionService = new SessionService(); And that's it, pretty much. And then for our Slack router, I will add, let's use new lines here because this line is getting pretty long already. I'm just passing down the SessionService we just instantiated. Now I'm heading into routes/bots/slack.js where first, also use new lines here, when we fetch the parent's object, SessionService. So I'm bringing in SessionService here as well. And then I will create the mentioned helper function that will simply provide…

Contents