Now that we've got a better idea of what all of our different action functions are going to do let's
make sure that we install axioms and set it up so we can make a request to our API.
So I gonna flip back over my terminal inside my project directory.
I'll do an npm install axioms like so while that's running I'll flip back over inside of my SDR see
directory.
I'm gonna make a new folder called API and then inside there I'm gonna make a new file to create and
configure an instance of axioms I'm going to call this simply tracker dot J.S. since we're accessing
our tracker API then inside of here we're going to import ASIO's
will then create an instance and export it.
So I'll say export default axiom stock create it for right now the only real configuration option we
want to put inside of here is our base U.R.L..
Remember your El right here is all capitals.
So what are we going to put in for the base your El.
Well cricket minor if you're running on a physical device in other words if you are testing your React
Native application on a physical device it is entirely possible that it might be running on a separate
network and if your device is running on a different network than your actual computer where the Express
API is your phone is not going to be able to very easily access that express API.
If your phone and your computer are on the same network it is possible to get your phone to access the
API.
But honestly I read lots of issues come up during that process.
You might be using a router or some network control you might be on a company Wi-Fi network or a public
Wi-Fi network that will not allow your phone to get direct access to the Express API.
So to solve all these possible issues we're just going to use that and grok tool once again remember
and grok is going to essentially open up a direct connection from your express API and give you a public
you URL that you can have your phone look at.
To get access to the API now.
Quick reminder here as soon as we start using any drug you have to use and grok at all times for the
rest of this application because it's the only way that your phone is going to build to contact the
Express server so that base your old property.
We're gonna put in whatever you are L and grok gives us to get access to the Express API.
Now remember if we are making use of and grok without paying any money so for using it freely.
The URL that we get is going to expire after 8 hours.
So that means that for the rest of this application if you take longer than 8 hours from like right
now to finish up the rest of this application at some point in time the end grok connection is going
to fail and you're going to have to restart and grok it's going to give you a new york URL and we're
going to use that as the new base you l with axioms.
So this line right here this applies to you 100 hundred percent.
You gotta remember after 8 hours eventually all your network requests from your device are going to
start to fail and to solve that you're gonna restart and grok take that new year out that you get and
throw it in right there with axioms.
So then mind I'm gonna flip back over to my terminal looks like Acciona is all done being installed
so going to very quickly make sure that I've got in Greek installed as well.
Remember we installed it globally just a little bit ago.
So just do a quick and grok like so and you should see a help message appear.
If you don't see that help message you can reinstall and grok with the NPM install dash G integral like
so OK so once we've got that up I'm going to make sure that I set up and grok and tell it to look at
my express API which I still have running inside of a different terminal window.
EXPRESS API is running on port three thousand unless you had to change it for some reason.
So now I've got one terminal window for my express API one for my react native bundler and now I'm going
to have a third terminal window for running and grok as well.
So inside this third window I'll do and grok H TTP and then the port that we want to expose on our local
computer.
In this case 3000 so once we run that we'll see that we now have eight hours left.
So there's the timer in eight hours.
This is going to expire and we need to update our bases where l it's now on this UI.
We have forwarding right here.
That right there is the address that will take us to local host three thousand so I'm going to copy
that and put it in here as my base you are El.
In addition just to make sure that you are L is working as expected we can very quickly try to access
it inside of our browser.
Remember right now our Express API if you went through all that setup let me pull open my code editor
for The Express API.
Here we go.
So we've got our Express API.
Remember we've got a default root root right here that's going to require you are user to be signed
in to view it.
So if we want to just make sure that grok is working correctly at any point in time we can navigate
directly to that you were all inside of our browser and we'll see something like You must be logged
in because once again in order to access that root root remember we had put in that middleware inside
there.
So at any point if you feel like and grok is not working correctly you can always paste that you URL
that you get from the terminal inside your browser try to access it and you should see a message like
that appear OK so now we've got this all put together once again just wanna remind you this is going
to apply to you in eight hours restart and grok through the New Year URL inside there.
OK.
Now we've got everything all set up.
Let's take a quick pause right here.
When come back the next video we're gonna take this Acciona instance and use it inside of our off context.