From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Fetching data and database querying plus ISR with Next.js

Fetching data and database querying plus ISR with Next.js

In this section, we really covered how to do dynamic routes with fetching data. However, we're looking at basically blog data that's created in a file system. What if we were using an API, which would be an application interface, which would be very common in the real world, or let's say we were even querying from a database. I think it's important that we just look at this because that's much more common types scenario that you could see even in a job interview scenario. let's go back to our post JS where we created the get all post IDs. So this code here, this is really the code that we're using to read the directory and then get the IDs for each one. All right, but let's say instead of getting the IDs, we were fetching from a database, what would that look like? Well, instead of, you know, creating a file name structure and whatnot, here, I'll put this in comments, I don't want to break our code. I just want you to see what we we could do is you know you'd have some kind of fetch…

Contents