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
tyler494914mo ago
I believe you need to move your file one level up from the /api directory and just into the root /pages directory

Did you find this page helpful?