From the course: Build a Lightweight Full-Stack Headless CMS Using Next.js, Contentful, and GraphQL
Unlock the full course today
Join today to access over 24,600 courses taught by industry experts.
Next.js and headless architecture for full-stack happiness - GraphQL Tutorial
From the course: Build a Lightweight Full-Stack Headless CMS Using Next.js, Contentful, and GraphQL
Next.js and headless architecture for full-stack happiness
- So let's go ahead and jump into some next JS code. Next JS is super lightweight. It's a framework that works really well with headless architecture because of a few of its features. There's easier routing, there's optimization of images and fonts, as well as server side rendering and efficient data fetching. Next JS really aims to solve a lot of the problems that earlier versions of React had, such as routing. Routing, I remember, was a very tedious task to set up, but now you don't need to follow along with this yet, but you can make a folder called Pages. And let's say you create a file called Oggie, which is my dog's name. This would take you to the base URL. Essentially it would be, let's say, local host 3000, and then it would be pages and it would take you to Oggie. So instead of having to set up a whole other routing, use a whole routing library doing something like this, just creating a folder and a file will create a path for you in the browser just like this. So that's…