-
Notifications
You must be signed in to change notification settings - Fork 0
Homework areas for improvement #1
Copy link
Copy link
Open
Description
Line 9 in f796bd3
| "test": "echo \"Error: no test specified\" && exit 1" |
If your application has no tests you can just delete this bit
Line 6 in f796bd3
| //const { htmlRouter, apiRouter } = require("./routes/delete"); |
Delete any unused, commented out code
| //const { getAllNotes, saveNotes, deleteNotes, getNotesById } = require("../controllers/apiControllers"); |
This would have worked fine instead of line 5 - why comment it out?
| const path = require("path"); |
No need for path or fs here, can be removed
note-taker-app/src/routes/apiRoutes.js
Line 13 in f796bd3
| //api/notes -> GET (all notes from db.json) |
More commented out code that can be removed
| const database = require("../../db/db.json"); |
| const BASE_URL = "http://localhost:3000/api/notes"; |
You're not using databse of BASE_URL here, can be removed
| fs.readFileSync(path.join(__dirname, "../../db/db.json"), "utf-8") |
Would be nice to see th fs methods extracted out to their own modules
note-taker-app/src/routes/htmlRoutes.js
Line 11 in f796bd3
| htmlRouter.get("/", renderIndexPage); |
Currently, if you hit an endpoint that is anything other than 'notes', the app breaks. You should add a star here (htmlRouter.get("/*", renderIndexPage); ) as a catch all, so if you enter an endpoint that is not /notes it will take you back to the landing/index page
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels