How do I get previews with route resolver instead of link resolver (next js)

I am trying to connect preview up. However there is no documentation on dealing with routeResolver only projects. I do not have a link resolver and the redirectToPreviewURL of the preview.js file requires one. Can anyone help?

import { routeResolver, createClient } from '../../../prismicio';
import { setPreviewData, redirectToPreviewURL } from '@prismicio/next';

export default async (req: any, res: any) => {
  const client = createClient({ req });
  await setPreviewData({ req, res });
  await redirectToPreviewURL({ req, res, client, routeResolver });
};

The above is an example where I tried to use routeResolver instead of linkResolver with no success. Thanks in advance.

Hello @nathan.doore

Welcome to the Prismic community, and thanks for reaching out to us.

To use Route resolver in your project for previews, you need to define routes in the prismicio.js file (where you initiate the client() function). Then, you don't need to import routeResolver and don't need to pass the routeResolver function in the redirectToPreviewURL. The routes you defined in the prismicio.js file will be available globally.
Learn more about how to define routes in the prismicio.js file: Link Resolver and Route Resolver - Prismic

Let me know if you have any further questions.

Thanks,
Priyanka