Created
November 8, 2022 07:45
-
-
Save szymonkorytnicki/60564ee4debecaa58635ee85edf18dee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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