Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the Node adapter in SvelteKit.
Svelte
import adapter from '@sveltejs/kit/adapter-[1]';
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'static' adapter which is for static site generation.
Using 'vercel' or 'netlify' adapters which are for specific platforms.
✗ Incorrect
The Node adapter is imported from '@sveltejs/kit/adapter-node' to enable deployment on Node.js servers.
2fill in blank
mediumComplete the code to configure the Node adapter in svelte.config.js.
Svelte
import adapter from '@sveltejs/kit/adapter-node'; export default { kit: { adapter: adapter({ [1] }) } };
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'outDir' instead of 'out' as the option key.
Setting the output directory to a non-standard folder.
✗ Incorrect
The Node adapter uses 'out' to specify the output directory, commonly set to 'build'.
3fill in blank
hardFix the error in the start script to run the built Node server.
Svelte
"scripts": { "start": "node [1]" }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'build/server.js' which does not exist in the build folder.
Running files without the 'build/' prefix.
✗ Incorrect
The Node adapter outputs the server file as 'build/index.js', so the start script should run that file.
4fill in blank
hardFill both blanks to complete the deployment command and environment variable for production.
Svelte
NODE_ENV=[1] npm run [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'development' instead of 'production' for NODE_ENV.
Running 'build' script instead of 'start' to launch the server.
✗ Incorrect
Set NODE_ENV to 'production' and run the 'start' script to launch the server in production mode.
5fill in blank
hardFill all three blanks to complete the minimal svelte.config.js for Node adapter deployment.
Svelte
import adapter from '@sveltejs/kit/adapter-[1]'; export default { kit: { adapter: adapter({ [2]: '[3]' }) } };
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'static' adapter instead of 'node'.
Using wrong option key like 'outDir' instead of 'out'.
Setting output folder to 'static' instead of 'build'.
✗ Incorrect
The Node adapter is imported as 'node', configured with 'out' set to 'build' folder.