Unlimited WordPress themes, graphics, videos & courses! Unlimited asset downloads! From $16.50/m
Angular 3
  • Overview
  • Transcript

6.1 The Server Side

Throughout this whole course, there's been the server side lurking in the background. We've made many requests to and got many responses from it. But we've never actually looked at it. And that's because it's pretty hacky as far as back ends go. If you're interested, I'll show you briefly here in this lesson what it was. As you can see, it's just on express server running in the background. And we have just an array of projects and an array of users. We have a couple of helper functions here, one for making users, which we only actually use here. We don't have that capability from the Front-End right now. But in a more fully featured application you, of course, would have something like that. We have a project function. We have a makeTask function. And you might say, well, there were no tasks. But actually, when I initially started this application, I assumed that a project would have a set of tasks. But instead it changed and it became a set of conversations. So as you can see inside, it still pushes into project.conversations. But I haven't actually changed all the function names. So we have makeTask, taskById, makeMessage, simple authenticateLogin. As you can see, here's the initial data that you saw throughout the application. We have a couple of users with just username and password. And of course, in a real application you would want a more fully featured authentication system, nothing like this. But this suited our purposes for this course. The avatars, by the way, I got from randomuser.me. You can find a bunch of random avatars there that you can use. And then of course, here we just have the making of the projects and the conversations and the messages. And then at the very bottom here we have the routes, which just accept the different data parameters and return the correct responses. So as you can see, it's a fairly basic backend. And once again, of course, in a real application you would want to do a whole lot more. But for a course that focused on Angular 2, I think this did the job pretty well.

Back to the top