Skip to content

A utility to check if the requested path a nextjs page script, generally present in .next/bundles/pages. Handy for figuring out whether this file can be served as gzip.

License

Notifications You must be signed in to change notification settings

imbhargav5/is-url-nextjs-page

Repository files navigation

is-url-nextjs-page

npm npm

Why?

I need to check if a resource being requested is a nextjs page and if it is, I need to serve it's gzipped version. So I wrote this utility to check if a given url is a nextjs page.

What

A utility to check if the requested path a nextjs page script, generally present in .next/bundles/pages.

Usage

import isUrlNextJsPage from "is-url-nextjs-page";
const isNextJsPage = isUrlNextJsPage(req.url);

Enjoy 📚📚

If you find any issues with it, please submit a PR or an issue!

About

A utility to check if the requested path a nextjs page script, generally present in .next/bundles/pages. Handy for figuring out whether this file can be served as gzip.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published