Skip to content

Instantly share code, notes, and snippets.

@szymonkorytnicki
Created November 8, 2022 07:45
Show Gist options
  • Save szymonkorytnicki/60564ee4debecaa58635ee85edf18dee to your computer and use it in GitHub Desktop.
Save szymonkorytnicki/60564ee4debecaa58635ee85edf18dee to your computer and use it in GitHub Desktop.
// const { pathname } = request.nextUrl;
function isPage(pathname: string): boolean {
return !(pathname.includes('.') || pathname.startsWith('/api') || pathname.includes('_next'));
}
// and consequently, you can work out how to identify a file a or an API route with this snippet!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment