created hackyourtemperature folder, created server.js#3
Open
Majoodeh wants to merge 1 commit intoHackYourAssignment:mainfrom
Open
created hackyourtemperature folder, created server.js#3Majoodeh wants to merge 1 commit intoHackYourAssignment:mainfrom
Majoodeh wants to merge 1 commit intoHackYourAssignment:mainfrom
Conversation
durw4rd
approved these changes
Nov 1, 2025
durw4rd
left a comment
There was a problem hiding this comment.
Good job finishing the assignment for this week, Majd. I left a note about validating the requests; no need to refactor this week's work, but validation will become more important as the applications get more complex.
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "start": "node server.js", | ||
| "dev": "nodemon server.js" |
Comment on lines
+14
to
+18
| app.post('/weather', (req, res) => { | ||
| console.log(req.body); | ||
| const { cityName } = req.body; | ||
| res.json(`the city name is ${cityName} `); | ||
| }); |
There was a problem hiding this comment.
If the successful response requires the presence of a certain attribute in the request, it's a good practice to validate the request in your handler. What should the application do if cityName is missing?
This was not mentioned as a requirement in the instructions, so don't worry too much about it, but it's good to start thinking about these things.
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.
No description provided.