So we appear to have all of our database functions to manage users and to get users and to get one user
set up here in models to go.
And of course, the first one we're going to use is this one, get all users and we're going to use
that in handlers dot API.
Her handlers dash.
Let's get that file and let's go to the very bottom and let's create a new handler that allows us to
call the back end and get all users.
So Funk with the receiver of appointed application and I'll call this all users.
And it takes W, which is an HDTV response writer
and ah, which is a pointer to a request because it's a handler and we're simply going to say all users
is assigned the value of all users and error are assigned the value of our DB dot get all users and
that takes no parameters.
We check for an error if error is not equal to nil after that request which takes W are in the error
and we return otherwise have not registered and that takes W status.
OK, we'll do the trick and our variable all users.
So that gives us our handler.
Let's set up a route to it.
Here we want in our protected routes will create a route that is a post route post and the route will
be API slash admin, slash all dash users and we'll hand it off to app, dot all users.
And that should take care of it.
OK, so the next step is to go to our front end page and add the necessary JavaScript to call this route
on the back end, and we'll do that in the next election.