Understanding capabilities of a next v 13.2 app that is using pages router

Hey guys, I'm a Front-end dev very comfortable with React, learning more about Next.js and I have a couple of questions, I'm doing a code exercise where the next app is using version 13.2, but it uses pages router, so no server components right? when creating api routes, I do need to export one default handler() function by file on the /pages/api folder, right? it seems that somehow getServerSideProps still works in this project, is it because when you use the pages router those functions still work? What are the other key things that I need to know in this kind of project? btw the project uses typescript
Solution:
Theo - t3․gg
YouTube
How NextJS REALLY Works
NextJS is probably the best way to build your next React application. There are few better ways to do full stack with Javascript. Hopefully this video helps you better understand why! THANK YOU MIR FOR THE GRIND TO GET THIS OUT TODAY!!! ALL MY CONTENT IS FILMED LIVE ON TWITCH AT https://twitch.tv/theo ALL MY BEST MEMES ARE ON TWITTER FIRST htt...
Jump to solution
5 Replies
Neto
Neto•15mo ago
when creating api routes, I do need to export one default handler() function by file on the /pages/api folder, right?
yes
I'm doing a code exercise where the next app is using version 13.2, but it uses pages router, so no server components right?
also yes
it seems that somehow getServerSideProps still works in this project, is it because when you use the pages router those functions still work?
pages router and app router are "different" products that you can use in the same project
lynn_phoenix
lynn_phoenix•15mo ago
I'm doing a code exercise where the next app is using version 13.2, but it uses pages router, so no server components right? Correct when creating api routes, I do need to export one default handler() function by file on the /pages/api folder, right? Correct it seems that somehow getServerSideProps still works in this project, is it because when you use the pages router those functions still work? Correct I would be sure to understand how the file based routing works in the pages directory. Know the difference between getServerSideProps, getStaticProps, getStaticPaths, and getInitialProps. Undestand the router and how things like next/link work. Outside of that, it's just general BE/FE concepts.
Solution
Neto
Neto•15mo ago
Theo - t3․gg
YouTube
How NextJS REALLY Works
NextJS is probably the best way to build your next React application. There are few better ways to do full stack with Javascript. Hopefully this video helps you better understand why! THANK YOU MIR FOR THE GRIND TO GET THIS OUT TODAY!!! ALL MY CONTENT IS FILMED LIVE ON TWITCH AT https://twitch.tv/theo ALL MY BEST MEMES ARE ON TWITTER FIRST htt...
Neto
Neto•15mo ago
an amazing video about nextjs its only about pages dir, but still valid
Wagner
WagnerOP•15mo ago
man that's awesome! thanks so much! I'm doing exactly this "I would be sure to understand how the file based routing works in the pages directory. Know the difference between getServerSideProps, getStaticProps, getStaticPaths, and getInitialProps. Undestand the router and how things like next/link work." so I'm on the right track thanks I'll watch this one right now 🙂 I forgot Theo had that video
Outside of that, it's just general BE/FE concepts.
this is awesome, I'm good then I'm comfortable with all the FE things, not the BE things because I'm front-end focused but the interview is for a front-end role so I'm safe 😄
Want results from more Discord servers?
Add your server