-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NextJS Guide? #18
Comments
I've added an example for Cloudflare Workers in the meantime, should be pretty close to Next: #19 |
Agree it would be great to have a nextjs example :) |
@FTCHD @txprojects88 have you tried? In NextJS project's root directory create import { NextResponse } from "next/server";
import Spiderable from 'spiderable-middleware';
const spiderable = new Spiderable({
rootURL: 'http://example.com',
auth: 'APIUser:APIPass'
});
const next () => {
return NextResponse.next();
};
export async function middleware(req, res) {
return spiderable.handler(req, res, next);
}; |
Get error
npm i --save-dev @types/spiderable-middleware did not work |
@txprojects88 How to use NPM package without Types Definitions? |
I declared the module but still getting Error: The edge runtime does not support Node.js 'https' module. |
@txprojects88 Are you sure you're adding this to server-only environment? Where this error is displayed? Terminal? Browser? |
I am using this in the middleware. Error is displayed in browser. |
@txprojects88 Doesn't sounds right. Hold on I'll try to reproduce on my end. What Router do you use? |
@txprojects88 And what version of next.js? |
app router |
14.0.3 |
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.
The text was updated successfully, but these errors were encountered: