How to exclude specific routes from Clerk middleware?

Anyone know how I can exclude the middleware from Clerk from running on my routes in folder: /api/cron?

Here's the current file:
import { authMiddleware } from "@clerk/nextjs";

// This example protects all routes including api/trpc routes
// Please edit this to allow other routes to be public as needed.
// See https://clerk.com/docs/references/nextjs/auth-middleware for more information about configuring your Middleware
export default authMiddleware({
  debug: false,
});

export const config = {
  matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
};


I believe we need to update the matcher but not sure how to do it correctly.
Was this page helpful?