how to do routing in nextjs?

how do i redirect to /new-page i used router.push it is not working. this code is present in pages/api/
No description
1 Reply
tyler4949
tyler494913mo ago
I believe you need to move your file one level up from the /api directory and just into the root /pages directory
Want results from more Discord servers?
Add your server