How to use Image and Preview in your Nextjs & Strapi Blog

Forget above :joy: :joy: :blush:

Too early on a Sunday for my brain to be in gear.

For any fellow Sunday morning imbeciles testing locally you go to http://localhost:3000/api/preview?secret=GwpRUnwb7otnm2InuPeWGYiUNn0TJ8PK&slug=how-to-play

secret comes from process.env.STRAPI_PREVIEW_SECRET and then is redirected using /api/preview.js with res.writeHead(307, { Location: /blogs/${slug} });