mirror of
https://github.com/withastro/astro.git
synced 2025-01-13 22:11:20 -05:00
24 lines
568 B
TypeScript
24 lines
568 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, config }) => {
|
|
setAdapter(getAdapter());
|
|
|
|
if (config.output === 'static') {
|
|
console.warn(`[@astrojs/Node] \`output: "server"\` is required to use this adapter.`);
|
|
}
|
|
},
|
|
},
|
|
};
|
|
}
|