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
From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
How to create dynamic routes with Next.js7m 15s
-
(Locked)
getStaticPaths with Next.js implementation5m 14s
-
(Locked)
Mastering dynamic static rendering with Next.js12m 3s
-
(Locked)
Rendering markdown and security vulnerabilities with injected HTML11m 23s
-
(Locked)
Polishing the dynamic post pages10m 43s
-
(Locked)
Polishing a Next.js component with styling7m 22s
-
(Locked)
Fetching data and database querying plus ISR with Next.js11m 26s
-
(Locked)
API routes with Next.js9m 1s
-
(Locked)
-