next-on-pages and modifying routes

So I only want page functions to run whenever I hit my nextjs API route, how can I do this?
Was this page helpful?