Routing

 Nextjs implements a file system based routing mechanisim

URLs paths thaat user can access in the browser are defined by Files and Folders in the code base.


Routing Conventions

  • All routes must be placed inside the app folder
  • Every file that has corresponds to a route must be names page.js ot page.tsx
  • Every folder corresponds to a path segment in the browser URL.
      

FileBased Routing

--->File and Folder structure determines the Routes


     
         The page.js file is in app folder maps to the domain


                  

        http://localhost:3000/profile
        http://localhost:3000/about
    


Comments

Popular posts from this blog

Basics of NextJS