1
00:00:00,270 --> 00:00:05,880
In the section, we're going to be demonstrating how to set up a local JSON server, so it's going to

2
00:00:05,880 --> 00:00:12,120
be an end point that's going to connect to a DB that Jason file, be able to load the content from the

3
00:00:12,360 --> 00:00:19,370
DB Jason file and interacted with it within JavaScript and also do the full CRUD operations.

4
00:00:19,380 --> 00:00:26,360
So let's create, read, update and delete to the content within the DB JSON file.

5
00:00:26,610 --> 00:00:33,270
So we've got a listing on the right hand side within the Web browser, all of the content that we have

6
00:00:33,270 --> 00:00:36,590
within the database file so we can also update it.

7
00:00:36,600 --> 00:00:42,000
So I'm just going to add Tu's to the ID one and do an update to it.

8
00:00:42,330 --> 00:00:47,010
And also we see that the DB Jason file updates correspondingly.

9
00:00:47,610 --> 00:00:54,320
We can also create new items, so creating a new item and that just gets added to the end.

10
00:00:54,690 --> 00:01:00,380
So within the test and this is a great way that you can create various endpoints.

11
00:01:00,750 --> 00:01:03,510
So they're all done with Jason Server.

12
00:01:03,510 --> 00:01:10,590
So running the Jason server locally gives you a great place to test practice and making all of your

13
00:01:10,590 --> 00:01:11,280
requests.

14
00:01:11,880 --> 00:01:20,610
So this includes doing the post and get to get all of the content, the loading of all of the content

15
00:01:21,090 --> 00:01:22,460
using create.

16
00:01:22,470 --> 00:01:29,790
So using that put method to add the content to the database and then also delete.

17
00:01:29,820 --> 00:01:35,820
So if we have an item that we want to delete, let's say number 17, we want to delete that, we press

18
00:01:35,820 --> 00:01:41,180
the delete button and that's going to remove it from our page as well as from the database.

19
00:01:41,820 --> 00:01:49,590
So all four of the basic functions for the persistent storage and are done with JavaScript connecting

20
00:01:49,590 --> 00:01:52,110
to the DB Jason.

21
00:01:52,260 --> 00:01:58,470
And this is going to be we are going to need to run node and node package manager in order to set up

22
00:01:58,470 --> 00:02:04,710
JSON server are going to be supplying the basic commands, opening up the terminal and running the commands

23
00:02:04,710 --> 00:02:07,110
so we can have our live database functioning in the back.

24
00:02:08,430 --> 00:02:15,030
If you have any questions or comments, please let me know all of the source code is included and as

25
00:02:15,210 --> 00:02:22,110
provided, try out the code within your own editor, make some updates and even customize and create

26
00:02:22,110 --> 00:02:27,870
your own JSON database that you can interact with and practice making AJAX requests with.
