Routing
Answered
Exotic Shorthair posted this in #help-forum
Exotic ShorthairOP
Hey i was just tryin to learn next js
as you can see this is my components and whenever i try to acess
am i doing something wrong ?
as you can see this is my components and whenever i try to acess
am i doing something wrong ?
24 Replies
Tonkinese
call it page
Answer
European sprat
page.js and read the docsExotic ShorthairOP
ty guys
iguess i'm fucking retard thaanks athanks
Tonkinese
Just spend more time on docs and youtube videos or something like Udemy, I guess that should be fine
Have fun learning.
Exotic ShorthairOP
did they change the docs or something
i swear i didn't have to name it page when i was doing the tuto
Tonkinese
You have to change between the old Pages Router and App Router in the Docs
Thats it
Exotic ShorthairOP
oh okey
well i'm gonna get used to this one ~ If anything i'm gonna be making a new post
thank you guys i apperaite it
Tonkinese
The Pages Router is the old one
Exotic ShorthairOP
oh so i should use the app router
i got it i got it
which one is better
thhe pages one or the app router ?
Tonkinese
Now we are using the App Router.
src/app
~ /about/page.tsx ---> localhost/about
~ /subpath/[id] ---> localhost/subpath/123 --> Get the 123 with Params
For API:
~ /api/subroute/route.tsx ---> localhost/subroute
# Choosing Router
src/app
~ /about/page.tsx ---> localhost/about
~ /subpath/[id] ---> localhost/subpath/123 --> Get the 123 with Params
For API:
~ /api/subroute/route.tsx ---> localhost/subroute
# Choosing Router
I am personally recommending everyone to use the new App Router.
Exotic ShorthairOP
okey okey ty
i'm gonna use the new one
Tonkinese
ðŸ‘