Next.js Discord

Discord Forum

Index.js vs Page.js

Answered
Cavalier King Charles Spaniel posted this in #help-forum
Open in Discord
Cavalier King Charles SpanielOP
Why do all tutorials reference index.js but mine was created with page.js was this a new change?
Answered by Giant panda
Old tutorials use the pages router while Next by default scaffolds apps using the new app router.
View full answer

4 Replies

Giant panda
Old tutorials use the pages router while Next by default scaffolds apps using the new app router.
Answer
Giant panda
Routing is still file-based but follows new naming conventions.
So when the create-next-app CLI asks you Would you like to use App Router? (recommended) No / Yes you can decide to not use the app router and will get a pages router project in case you want to stick to the old patterns.
@Giant panda Old tutorials use the pages router while Next by default scaffolds apps using the new app router.
Cavalier King Charles SpanielOP
ah okay, so now all pages are stored in app