We've now got our 3D terminal windows running for our project.
Now we're gonna figure out how we can somehow interact with our Jason server from our React Native application
to interact from our ReACT native app over to Jason server.
We're going to be making plain network requests to make a network request.
We're going to again use that access library.
So we need to make sure that we install access into our project to do so I'm going to open up another
terminal window.
I know we've gotten many different ones going on here.
I'm gonna open up another terminal window inside of my blog.
Project directory and then inside they're all install access with npm install access like so.
All right while that's running.
I'm just gonna let it do its thing and I'm gonna show you a quick diagram to understand how we interact
with Jason server all right.
Here we go so to interact with our Jason server and manipulate that blog post resource we're gonna follow
a very strict set of rules.
Anytime that we want to say get a list of all of our stored blog posts we're going to make a get type
request to the slash blog post route that was created by our Jason server.
If we make a get request to slash blog posts Jason server will automatically respond with all of the
blog posts we've ever created.
Likewise if we make a get request to slash blog post slash and then the I.D. of a blog post Jason server
will give us that particular blog post.
One thing I wanna mentioned about the ideas here is that right now inside of our application you and
I are creating our ideas randomly.
Right when we start making use of Jason server Jason server is going to automatically assign I.D. to
every blog post we create.
So we no longer have to worry about creating ideas manually inside of our app.
We're going to instead rely upon the Jason server to do it for us so we can also go over some of these
other routes inside of here.
For example if we want to create a blog post we will make a post request to slash blog posts and I'm
sure you can read the other ones inside of here as well.
So these are rules that Jason server uses right out of the box and we do not have to add in any further
configuration to make use of any of this stuff.
Now one thing I wanna remind you about is that we're using and grok to connect to our JS on server.
So what you see right here is just the route that we're gonna make the request to.
But we still need an actual domain or address that we're making our request to.
So to actually specify the full address that we're gonna make our request to we can go back over to
the end truck window and remember there's this forwarding section right here.
We're gonna take that H TTP link I'm gonna copy that and then we're going to essentially do a request
to that like so so we're going to make a request to blah blah blah dot and grok slash blog posts and
that's how we're going to get our list of all of our different blog posts.
So now hopefully it's a little bit more clear why any time that we restart our end grok server and get
a new identifier right there we are gonna have to go into our source code and update our address.
So every time we restart and grok well I'll do it right now so I'll restart that thing.
I've now got a different identifier which means if I want to contact that Jason server I now need to
make a request to this slightly different you are l like so I know this is really awkward if you want
to you can't pay for an account with n grok and if you pay for an account within grok which is just
a couple bucks a month they will give you a static subdomain so you don't have to come back and change
this all the time.
But for right now this really is the easiest and best option that is available to us okay.
So we understand how we're going to interact with our Jason server and how in grok kind of factors in
here.
Let's take another quick pause in the next video we're going to start writing in our first request from
our application.