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/

1 Reply
I believe you need to move your file one level up from the
/api
directory and just into the root /pages
directory