Checkpoint · Lesson 1.1
npm init and a first Express server: checkpoint files
Compare your folder with the reference using Git, if you cloned it: git diff lesson/m01-l01 -- src.
Files changed in this lesson
.gitignore added
.gitignorenode_modules/
.env
node_modules/.env.npmrc added
.npmrcsave-exact=true
save-exact=truepackage-lock.json added
Generated by npm from package.json. Do not edit it by hand; run the npm commands from the lesson.
package.json added
package.json{
"name": "caretaker",
"version": "1.0.0",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node src/server.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"type": "module",
"dependencies": {
"express": "5.3.0"
}
}
{ "name": "caretaker", "version": "1.0.0", "description": "", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node src/server.js" }, "keywords": [], "author": "", "license": "ISC", "type": "module", "dependencies": { "express": "5.3.0" }}src/server.js added
src/server.jsimport express from 'express';
const app = express();
const port = 3000;
app.get('/', (req, res) => {
res.send('Caretaker is running');
});
app.listen(port, () => {
console.log(`Caretaker listening on http://localhost:${port}`);
});
import express from 'express'; const app = express();const port = 3000; app.get('/', (req, res) => { res.send('Caretaker is running');}); app.listen(port, () => { console.log(`Caretaker listening on http://localhost:${port}`);});Project tree at this checkpoint
.gitignore
.npmrc
package-lock.json
package.json
src/server.js