1 00:00:01,100 --> 00:00:04,300 We've now got our 3D terminal windows running for our project. 2 00:00:04,340 --> 00:00:09,080 Now we're gonna figure out how we can somehow interact with our Jason server from our React Native application 3 00:00:09,620 --> 00:00:12,950 to interact from our ReACT native app over to Jason server. 4 00:00:12,950 --> 00:00:17,120 We're going to be making plain network requests to make a network request. 5 00:00:17,120 --> 00:00:19,700 We're going to again use that access library. 6 00:00:19,700 --> 00:00:25,010 So we need to make sure that we install access into our project to do so I'm going to open up another 7 00:00:25,010 --> 00:00:25,730 terminal window. 8 00:00:25,730 --> 00:00:28,120 I know we've gotten many different ones going on here. 9 00:00:28,160 --> 00:00:30,850 I'm gonna open up another terminal window inside of my blog. 10 00:00:30,850 --> 00:00:38,560 Project directory and then inside they're all install access with npm install access like so. 11 00:00:38,810 --> 00:00:39,800 All right while that's running. 12 00:00:39,800 --> 00:00:43,820 I'm just gonna let it do its thing and I'm gonna show you a quick diagram to understand how we interact 13 00:00:43,820 --> 00:00:46,850 with Jason server all right. 14 00:00:46,860 --> 00:00:53,310 Here we go so to interact with our Jason server and manipulate that blog post resource we're gonna follow 15 00:00:53,340 --> 00:00:55,860 a very strict set of rules. 16 00:00:55,980 --> 00:01:01,980 Anytime that we want to say get a list of all of our stored blog posts we're going to make a get type 17 00:01:01,980 --> 00:01:07,380 request to the slash blog post route that was created by our Jason server. 18 00:01:07,380 --> 00:01:12,870 If we make a get request to slash blog posts Jason server will automatically respond with all of the 19 00:01:12,870 --> 00:01:15,120 blog posts we've ever created. 20 00:01:15,120 --> 00:01:21,780 Likewise if we make a get request to slash blog post slash and then the I.D. of a blog post Jason server 21 00:01:21,810 --> 00:01:24,580 will give us that particular blog post. 22 00:01:24,630 --> 00:01:28,620 One thing I wanna mentioned about the ideas here is that right now inside of our application you and 23 00:01:28,620 --> 00:01:31,200 I are creating our ideas randomly. 24 00:01:31,230 --> 00:01:37,380 Right when we start making use of Jason server Jason server is going to automatically assign I.D. to 25 00:01:37,380 --> 00:01:39,210 every blog post we create. 26 00:01:39,450 --> 00:01:43,490 So we no longer have to worry about creating ideas manually inside of our app. 27 00:01:43,500 --> 00:01:49,590 We're going to instead rely upon the Jason server to do it for us so we can also go over some of these 28 00:01:49,620 --> 00:01:50,870 other routes inside of here. 29 00:01:50,880 --> 00:01:56,850 For example if we want to create a blog post we will make a post request to slash blog posts and I'm 30 00:01:56,850 --> 00:01:58,740 sure you can read the other ones inside of here as well. 31 00:01:59,610 --> 00:02:04,830 So these are rules that Jason server uses right out of the box and we do not have to add in any further 32 00:02:04,830 --> 00:02:07,170 configuration to make use of any of this stuff. 33 00:02:08,960 --> 00:02:14,000 Now one thing I wanna remind you about is that we're using and grok to connect to our JS on server. 34 00:02:14,090 --> 00:02:17,820 So what you see right here is just the route that we're gonna make the request to. 35 00:02:17,840 --> 00:02:22,430 But we still need an actual domain or address that we're making our request to. 36 00:02:22,460 --> 00:02:28,280 So to actually specify the full address that we're gonna make our request to we can go back over to 37 00:02:28,280 --> 00:02:32,570 the end truck window and remember there's this forwarding section right here. 38 00:02:32,570 --> 00:02:40,310 We're gonna take that H TTP link I'm gonna copy that and then we're going to essentially do a request 39 00:02:40,520 --> 00:02:48,610 to that like so so we're going to make a request to blah blah blah dot and grok slash blog posts and 40 00:02:48,610 --> 00:02:52,030 that's how we're going to get our list of all of our different blog posts. 41 00:02:52,120 --> 00:02:56,920 So now hopefully it's a little bit more clear why any time that we restart our end grok server and get 42 00:02:56,920 --> 00:03:02,260 a new identifier right there we are gonna have to go into our source code and update our address. 43 00:03:02,260 --> 00:03:08,000 So every time we restart and grok well I'll do it right now so I'll restart that thing. 44 00:03:08,200 --> 00:03:13,660 I've now got a different identifier which means if I want to contact that Jason server I now need to 45 00:03:13,660 --> 00:03:19,990 make a request to this slightly different you are l like so I know this is really awkward if you want 46 00:03:19,990 --> 00:03:24,850 to you can't pay for an account with n grok and if you pay for an account within grok which is just 47 00:03:24,850 --> 00:03:29,320 a couple bucks a month they will give you a static subdomain so you don't have to come back and change 48 00:03:29,320 --> 00:03:30,700 this all the time. 49 00:03:30,700 --> 00:03:35,850 But for right now this really is the easiest and best option that is available to us okay. 50 00:03:35,890 --> 00:03:40,470 So we understand how we're going to interact with our Jason server and how in grok kind of factors in 51 00:03:40,470 --> 00:03:41,060 here. 52 00:03:41,070 --> 00:03:46,110 Let's take another quick pause in the next video we're going to start writing in our first request from 53 00:03:46,170 --> 00:03:47,010 our application.