NW6 | Rabia Avci | Module Servers | [TECH ED] Mailing list API Project | Week 4 #177
Open
RbAvci wants to merge 6 commits intoCodeYourFuture:mainfrom
Open
NW6 | Rabia Avci | Module Servers | [TECH ED] Mailing list API Project | Week 4 #177RbAvci wants to merge 6 commits intoCodeYourFuture:mainfrom
RbAvci wants to merge 6 commits intoCodeYourFuture:mainfrom
Conversation
|
Ara225
reviewed
May 6, 2024
|
|
||
| const app = express(); | ||
| app.use(express.json()); | ||
| app.disable("x-powered-by"); |
There was a problem hiding this comment.
Is there any particulaur reason for this line of code? It's a good question to ask yourself whenever you find anything odd in code.
| app.use(express.json()); | ||
| app.disable("x-powered-by"); | ||
|
|
||
| const mailList = mailinglist; |
There was a problem hiding this comment.
Another line that doesn't make too much sense to me - is there any particuluar reason that the var needs reassigned?
| app.get("/lists", (req, res) => { | ||
| const listsArray = Object.keys(mailList); | ||
| res.status(200).json(listsArray); | ||
| }); |
There was a problem hiding this comment.
Good work, appreciate the comments - makes it easier to skim read
| } else { | ||
| res.status(404).json({ error: "List not found" }); | ||
| } | ||
| }); |
| } else { | ||
| res.status(404).json({ message: "Name not found for delete" }); | ||
| } | ||
| }); |
| mailList[name] = members; | ||
| res.status(201).json({ message: "New list created successfully." }); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Amazing, nice to see you've done the stretch goal as well!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Learners, PR Template
Self checklist
Changelist
Created a Mailing List REST API.
Routes
/lists - fetch all the existing list names
/lists/:name - get list by name, delete by name, add or update a list with the given name // adjusted with different status codes such as 200,201,404
Stretch 1 is done: checks if the path matches the name in JSON.