0
0
Svelteframework~10 mins

Node adapter deployment in Svelte - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
Anetlify
Bstatic
Cvercel
Dnode
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.
2fill in blank
medium

Complete 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'
AoutDir: 'output'
Bout: 'build'
CoutDir: 'build'
Dout: 'output'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'outDir' instead of 'out' as the option key.
Setting the output directory to a non-standard folder.
3fill in blank
hard

Fix 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'
Abuild/index.js
Bindex.js
Cserver.js
Dbuild/server.js
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'build/server.js' which does not exist in the build folder.
Running files without the 'build/' prefix.
4fill in blank
hard

Fill 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'
Aproduction
Bstart
Cdevelopment
Dbuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'development' instead of 'production' for NODE_ENV.
Running 'build' script instead of 'start' to launch the server.
5fill in blank
hard

Fill 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'
Anode
Bout
Cbuild
Dstatic
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'.