Next.js Discord

Discord Forum

App routing trouble

Answered
NanotechPikachu posted this in #help-forum
Open in Discord
Avatar
Hi.
I am experiencing trouble with the app routing as the domain.com/docs/start sends me a 404 error while I have a file in ./src/app/docs/start.js
I am wondering if I did something wrong in it. Please help me.

Full code can be found here: https://github.com/NanotechPikachu/Next
Answered by jason
In your docs folder, you need to create a new folder called start and a page.js file in there

So whatever contents you have in your start.js, move that to the new page.js

Folder structure should be something like
app/docs/start/page.js
View full answer

4 Replies

Avatar
In your docs folder, you need to create a new folder called start and a page.js file in there

So whatever contents you have in your start.js, move that to the new page.js

Folder structure should be something like
app/docs/start/page.js
Answer
Avatar
So, each page would be a new folder? You can't make direct files to be a page. Am I right?
Avatar
Yes that's how the app dir structure works and the page would have to be named page.jsx or .tsx with typescript
Avatar
Oh thanks