Skip to content

Add Koa middleware#2

Open
Lasalot wants to merge 2 commits intomainfrom
add-prerender-koa
Open

Add Koa middleware#2
Lasalot wants to merge 2 commits intomainfrom
add-prerender-koa

Conversation

@Lasalot
Copy link
Copy Markdown
Collaborator

@Lasalot Lasalot commented Apr 21, 2026

Initial implementation of the Prerender.io integration for koa.

Comment thread index.js
headers['X-Prerender-Int-Type'] = 'Koa';
const response = await fetch(apiUrl, { headers, redirect: 'manual' });
const body = await response.text();
return { status: response.status, body };
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Hapi one returns the forwarded headers, is it intentional?

Comment thread index.js
return { status: response.status, body };
}

module.exports = function prerenderMiddleware(options = {}) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no beforeRender/afterRender hooks. The Hapi plugin has them; this one doesn't, is it intentional?

Comment thread package.json
],
"repository": {
"type": "git",
"url": "git://github.com/prerender/integrations",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think should be prerender/koa

Comment thread package.json
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be missing

"files": ["index.js"]

if we publish on npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants