WEBVTT 00:01.300 --> 00:07.120 So we appear to have all of our database functions to manage users and to get users and to get one user 00:07.120 --> 00:09.070 set up here in models to go. 00:09.100 --> 00:13.990 And of course, the first one we're going to use is this one, get all users and we're going to use 00:13.990 --> 00:16.090 that in handlers dot API. 00:16.960 --> 00:17.980 Her handlers dash. 00:19.060 --> 00:24.460 Let's get that file and let's go to the very bottom and let's create a new handler that allows us to 00:24.460 --> 00:27.160 call the back end and get all users. 00:27.850 --> 00:34.120 So Funk with the receiver of appointed application and I'll call this all users. 00:35.170 --> 00:38.320 And it takes W, which is an HDTV response writer 00:41.170 --> 00:48.610 and ah, which is a pointer to a request because it's a handler and we're simply going to say all users 00:49.270 --> 00:59.950 is assigned the value of all users and error are assigned the value of our DB dot get all users and 00:59.950 --> 01:01.300 that takes no parameters. 01:01.630 --> 01:09.550 We check for an error if error is not equal to nil after that request which takes W are in the error 01:09.820 --> 01:17.920 and we return otherwise have not registered and that takes W status. 01:17.950 --> 01:21.510 OK, we'll do the trick and our variable all users. 01:22.300 --> 01:23.530 So that gives us our handler. 01:23.710 --> 01:24.870 Let's set up a route to it. 01:26.060 --> 01:35.840 Here we want in our protected routes will create a route that is a post route post and the route will 01:35.840 --> 01:43.070 be API slash admin, slash all dash users and we'll hand it off to app, dot all users. 01:46.780 --> 01:47.830 And that should take care of it. 01:48.040 --> 01:55.030 OK, so the next step is to go to our front end page and add the necessary JavaScript to call this route 01:55.030 --> 01:57.540 on the back end, and we'll do that in the next election.