Essentials
Routing
Guide to setting up routes in SaasCart using Next.js 14 App Router
Creating Routes
This guide covers how to create routes for your SaasCart pages using Next.js 14’s App Router, which introduces new file conventions to streamline creating pages, layouts, and templates.
Defining Routes
In Next.js, a route’s UI is represented by a page component, defined by exporting a component from a page.js
file. Use nested folders to specify the route path, and add a page.js
file to make it publicly accessible.
To start, add a page.js
file to the app
directory to define your first route:
Defining Module Routes
app/account/dashboard/page.js
Defining Module Routes
To remove a page from SaasCart, just delete the page.js file from your app directory. This action will delete the page from your application.