astro/packages/integrations/node/src/index.ts
2022-04-14 13:52:56 +00:00

20 lines
423 B
TypeScript

import type { AstroAdapter, AstroIntegration } from 'astro';
export function getAdapter(): AstroAdapter {
return {
name: '@astrojs/node',
serverEntrypoint: '@astrojs/node/server.js',
exports: ['handler'],
};
}
export default function createIntegration(): AstroIntegration {
return {
name: '@astrojs/node',
hooks: {
'astro:config:done': ({ setAdapter }) => {
setAdapter(getAdapter());
},
},
};
}