veliovgroup / spiderable-middleware

🤖 Prerendering for JavaScript powered websites. Great solution for PWAs (Progressive Web Apps), SPAs (Single Page Applications), and other websites based on top of front-end JavaScript frameworks
https://www.npmjs.com/package/spiderable-middleware
BSD 3-Clause "New" or "Revised" License
36 stars 4 forks source link

NextJS Guide? #18

Open FTCHD opened 4 months ago

FTCHD commented 4 months ago

I'd love to be the one to add it but I'm not so familiar with how this should be integrated.

I've integrated prerender in the past and their NextJS middleware is pretty straight forward, not sure if just doing a copy pasta for spiderable would work?

For reference, here are the prerender docs for Next:

Ideally, we edit Next middleware to check if the request is a bot, and if so we send it to Ostr for prerendering.

This is a touchy topic (regarding SEO and not screwing up page/domain scores), so that why I'm reticent to do it without the proper experience of how spiderable works.

This would potentially unlock a lot of new users, right now NextJS users have only one easy/default option.

FTCHD commented 4 months ago

I've added an example for Cloudflare Workers in the meantime, should be pretty close to Next: https://github.com/veliovgroup/spiderable-middleware/pull/19