| Level Navigation: 1 | 2 | 3 | (4ℹ️) | (5ℹ️) | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14⚡ | 15⚡ | (16ℹ️) | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26⚡ | 27⚡ | 28⚡ | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39⚡ | 40⚡ |
Practice spinning up an Express app and verifying that you can access it from a client. This level should feel quick—you only need a root route and confidence that the server responds.
Before starting your server, it’s helpful to understand the tools you’ll use to run your Node.js application:
node vs nodemonnode is the Node.js runtime itself—the program that executes JavaScript files:
node src/index.jsnodemon is a development tool that wraps node with automatic restarts:
node insteadExample:
# Using node directly (manual restart required)
node src/index.js
# Using nodemon (auto-restart on file changes)
nodemon src/index.js
npm run start vs npm run devThese are npm scripts defined in your package.json. The difference depends on what each script does:
npm run start (Production/Standard):
node (production mode)"start": "node src/index.js"npm run dev (Development):
nodemon (development mode)"dev": "nodemon src/index.js"Why have both?
npm run dev for auto-restart convenience while codingnpm run start for stable, predictable server executionCheck your package.json:
{
"scripts": {
"start": "node src/index.js",
"dev": "nodemon src/index.js"
}
}
npm run dev
http://localhost:3000 in your browserdev):
http://localhost:3000 in your browser