-
Notifications
You must be signed in to change notification settings - Fork 1
/
middleware.ts
25 lines (21 loc) · 882 Bytes
/
middleware.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Middleware clerk
import { authMiddleware } from "@clerk/nextjs";
// See https://clerk.com/docs/references/nextjs/auth-middleware
// for more information about configuring your Middleware
export default authMiddleware({
// Allow signed out users to access the specified routes:
// publicRoutes: ['/anyone-can-visit-this-route'],
// Prevent the specified routes from accessing
// authentication information:
// ignoredRoutes: ['/no-auth-in-this-route'],
publicRoutes: ["/api/uploadthing", "/api/socket/io"]
});
export const config = {
matcher: [
// Exclude files with a "." followed by an extension, which are typically static files.
// Exclude files in the _next directory, which are Next.js internals.
"/((?!.+\\.[\\w]+$|_next).*)",
// Re-include any files in the api or trpc folders that might have an extension
"/(api|trpc)(.*)"
]
};