148e61d249
* feat: remove webapi in favor of a smaller polyfill
* test: remove old test
* test: 🤦♀️
* chore: changeset
18 lines
506 B
TypeScript
18 lines
506 B
TypeScript
import type { SSRManifest } from 'astro';
|
|
import { NodeApp, applyPolyfills } from 'astro/app/node';
|
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
|
|
applyPolyfills();
|
|
|
|
export function createExports(manifest: SSRManifest) {
|
|
const app = new NodeApp(manifest);
|
|
return {
|
|
handler: async (req: IncomingMessage, res: ServerResponse) => {
|
|
const start = performance.now();
|
|
await app.render(req);
|
|
const end = performance.now();
|
|
res.write(end - start + '');
|
|
res.end();
|
|
},
|
|
};
|
|
}
|