18.

How can you define a custom API route in Next.js?

Import the API module from Next.js and use its route method

Define a route in the server.js file

Use the getServerSideProps function in a regular page component

Create a new file in the pages/api directory