Full Stack Camp
رفتن به کانال در Telegram
Fullstack Camp | Learn. Build. Launch. Join us for a hands-on journey through HTML, CSS, JavaScript, React, Node.js, Express & MongoDB — all in one place. Use this bot to search for lessons. @FullstackCamp_assistant_bot DM: @Tarikey6
نمایش بیشترکشور مشخص نشده استدسته بندی مشخص نشده است
235
مشترکین
اطلاعاتی وجود ندارد24 ساعت
+37 روز
+530 روز
آرشیو پست ها
1️⃣5️⃣ What is the biggest downside of file-based storage (fs) APIs?
1️⃣1️⃣Which situation will cause an Express app to hang (never respond)?
💥Week 7 Day 7 challenges
🧩 Challenge 1: Modular Blog API
👉 Build a small blog API using Express Router.
Requirements:
Create routes folder
🗂️ posts.js
🗂️ authors.js
Each file should export a router
Main app.js must use them like:
app.use("/posts", postsRouter); app.use("/authors", authorsRouter);
Endpoints to include (just dummy responses):
✔ /posts/ → return list of posts
✔ /posts/:id → return a single post
✔ /authors/ → return list of authors
✔ /authors/:id → return author details
Add middleware:
Use morgan for request logging
Use uuid to generate post IDs
🧩 Challenge 2: Notes API with Router + File Storage
👉 Build a simple Notes API, split into modules:
📁 /routes/notes.js
📁 /data/notes.json
Endpoints:
✔ GET /notes → return all notes
✔ POST /notes → add a new note
✔ DELETE /notes/:id → delete a note
Requirements:
➙Use uuid to generate IDs
➙Use fs to read/write JSON file
➙Use express.json()` middleware
Extra:
Add CORS package so any frontend can access it
🧩 Challenge 3: Student Manager
👉 Create Student Manager with:
📁 /routes/students.js
📁 /data/students.json
Endpoints:
✔ GET /students
✔ POST /students
✔ GET /students/:id
✔ DELETE /students/:id
Use packages:
dotenv → load PORT from .env
nodemon → auto restart
.env example:
PORT=4000
🎁 Optional Bonus
Add routes with Router-level middleware:
Example:
router.use((req, res, next) => {
console.log("Students Router middleware running");
next(); });
When you are done:
💥share your solutions in the group,
💥invite a friend,
and as always —
💥stay well, stay curious, and stay coding ✌️