Building A Fake REST API - JSON Server + TypeScript

preview_player
Показать описание
JSON Server is a great way to set up a full fake REST API for front-end development. JSON server can be set up literally in ‘30 seconds’ and with no coding as the website claims.

In this video, let’s look at customizing and configuring JSON Server for some common API scenarios like custom routes, list and summary data view, etc. We will use TypeScript to set up the mock data which keeps the mock data up to date with the API specs.

Рекомендации по теме
Комментарии
Автор

amazingly detailed video Rahul. this is my first comment in youtube after watching so many videos for so many years. Couldn't resist appreciating your video. So detailed, with clear and modulated voice and I was able to setup the whole mock api in no time.

rajadgreat
Автор

Thank you. I was looking for this all day for my project LOL

idevbrandon
Автор

Also try to increase the font size of your editor or any other apps NSwag for example so that its more readable. The font size in this video is microscopic.

gitpub
Автор

I m having problem to setup count of the total data inside the object but it is nested object so crud doesn't work can u tell me a way around this

{
"todos": {
"data": [
{
"id": 1,
"title": "one",
"description": "test",
"priority": 1,
"duedate": "2020-07-25T06:20:28.000+0000",
"owner": "Ahmad, Mohammad Afindee"
},
{
"title": "fgsfdg",
"description": "fgsfd",
"priority": 2,
"duedate": "2020-07-25T06:39:32.000+0000",
"owner": "Bin Abdul Rahim, Mohammad Rais",
"id": 2
}
]
, "count" : 2}
}

kapilj
Автор

Thanks for great video. I am facing one challenge, When I run my server like "start:api": "npx ts-node src/services/mockApi/server.ts", I get "Cannot use import statement outside a module". Now sure what is wrong here.

rakeshjks
Автор

can u help me to change resourceVariables of url in json-server example it uses "/?_page" but i want to use "/offset" for every aother url i pass and not with custom routes

kapiljaiswal