1 00:00:01,350 --> 00:00:05,390 Now that we've put together this kind of demonstration root handler inside of our current user dot TSA 2 00:00:05,400 --> 00:00:10,130 file we're gonna make one or two small changes to it and then duplicate the setup to the other three 3 00:00:10,140 --> 00:00:12,690 route handling files that we already put together. 4 00:00:12,690 --> 00:00:19,160 The first thing I'm going to do is add in the arguments to the callback function so rec and rez and 5 00:00:19,170 --> 00:00:22,650 then inside up here I'm going to put together the same implementation we had a little bit ago. 6 00:00:22,770 --> 00:00:25,670 So I'll do a resort send of hi there like so 7 00:00:29,010 --> 00:00:29,400 OK. 8 00:00:29,450 --> 00:00:35,420 So let's now take this configuration or this code we're going to copy paste it over to a sign in sign 9 00:00:35,420 --> 00:00:40,580 out and sign up will then change on the different routes just to make sure that they all correspond 10 00:00:41,330 --> 00:00:46,650 to different routes so we had specified over in this diagram it's going to take everything inside of 11 00:00:46,660 --> 00:00:48,450 you're going to copy it. 12 00:00:48,450 --> 00:00:55,940 I'm going to go first to sign in and paste it and then save I'll go to sign out and paste and then save 13 00:00:56,480 --> 00:01:01,960 it then I'll go to sign up and paste and save and then going to close. 14 00:01:01,970 --> 00:01:08,000 Current user I'm going to close indexed dot T.S. and we're going to update sign in sign out and sign 15 00:01:08,000 --> 00:01:12,950 up one by one in each these we're just gonna make sure that they have the appropriate routes and the 16 00:01:12,950 --> 00:01:14,350 appropriate method as well. 17 00:01:15,610 --> 00:01:21,700 So going to first begin inside of signing dot to yes inside of you're going to change the routes to 18 00:01:22,760 --> 00:01:31,380 API users sign in we'll change the method to be a post and then I'll change the name of the router down 19 00:01:31,380 --> 00:01:40,760 here at the bottom as well I'll change that to sign in router I'll then save this file and close it. 20 00:01:40,780 --> 00:01:43,190 Next up is sign out. 21 00:01:43,190 --> 00:01:50,610 So inside of sign out we will change this to a post request to API users sign out so I'll take it to 22 00:01:50,640 --> 00:01:58,230 a post API users sign out and then finally I'm going to update the name of the router at the bottom 23 00:01:58,920 --> 00:02:05,270 those sign out router and then finally over to sign up dot. 24 00:02:05,280 --> 00:02:15,710 Yes so this one should be a post request to API users sign up a post API users sign up and then very 25 00:02:15,710 --> 00:02:22,280 similarly I will update the name of the router at the bottom as well so sign up router All right. 26 00:02:22,310 --> 00:02:25,730 So we've got a little bit of scaffolding put together for all for these files. 27 00:02:25,730 --> 00:02:30,320 Let's now go and associate each these different routers with our Express application back inside the 28 00:02:30,320 --> 00:02:38,170 index dot ts file tobacco over here right after our current user router imports I'll add an import for 29 00:02:38,590 --> 00:02:48,330 sign in router from routes sign in then sign out router 30 00:02:52,870 --> 00:02:55,510 and finally sign up router 31 00:03:01,390 --> 00:03:05,420 I'll then make sure that I associate each of those routers with our Express application right after 32 00:03:05,420 --> 00:03:13,250 the current user 1 we put together down there so we'll do an app dot use sign in router and app dot 33 00:03:13,250 --> 00:03:24,100 use sign out router and an app dot use sign up router we're going to be doing a lot of steps like what 34 00:03:24,100 --> 00:03:27,910 we just did between the last video and this one throughout the rest of this application where we create 35 00:03:27,940 --> 00:03:32,020 a set of files together and then put some similar scaffolding into each of them. 36 00:03:32,260 --> 00:03:36,010 The reason for this is that a lot of the code that we're going to end up writing is going to be unfortunately 37 00:03:36,010 --> 00:03:39,450 a little bit similar to each other I suppose. 38 00:03:39,470 --> 00:03:44,950 Now I wanna make sure that we save as much as time as possible because honestly we have a incredible 39 00:03:45,490 --> 00:03:48,670 really an incredible amount of code to write for this application. 40 00:03:48,670 --> 00:03:50,260 Way more than you would ever expect. 41 00:03:50,260 --> 00:03:55,510 I just wanna make sure that this all gets together in a very formulaic fashion with as few mistakes 42 00:03:55,510 --> 00:03:57,200 and typos as possible. 43 00:03:57,220 --> 00:04:02,080 That's really easy to do if we just go through and kind of scaffold all this stuff in one go. 44 00:04:02,110 --> 00:04:05,020 So it looks pretty good because right here continue in just a minute.