astro/packages/integrations/node/src/index.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
568 B
TypeScript
Raw Normal View History

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());
2022-07-25 04:20:38 +00:00
if (config.output === 'static') {
console.warn(`[@astrojs/Node] \`output: "server"\` is required to use this adapter.`);
}
2022-04-14 13:52:56 +00:00
},
2022-03-24 11:27:15 +00:00
},
};
}