Complete the code to import the Node.js adapter in an Astro project.
import node from '[1]';
The Node.js adapter is imported from @astrojs/node to enable self-hosting.
Complete the code to add the Node.js adapter in the Astro config file.
export default {
adapter: [1](),
};Use node() to configure the Node.js adapter in the Astro config.
Fix the error in the server start script to use the Node.js adapter correctly.
import { startServer } from 'astro/server'; import node from '@astrojs/node'; await startServer({ adapter: [1] });
The adapter must be called as a function node() when passed to startServer.
Fill both blanks to configure the Node.js adapter with a custom port and hostname.
export default {
adapter: node({
port: [1],
hostname: '[2]'
}),
};Commonly, port 3000 is used and 127.0.0.1 is the hostname for local self-hosting.
Fill all three blanks to create a minimal Node.js server using the Astro adapter.
import node from '[1]'; import { startServer } from '[2]'; await startServer({ adapter: [3]() });
Import the Node.js adapter from @astrojs/node, the server starter from astro/server, and pass node() as the adapter to startServer.
