Skip to content

Conversation

@YaroslavKazeev
Copy link

Assignments week 1 Yaroslav Kazeev

Copy link

@durw4rd durw4rd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job finishing the assignment exactly according to the instructions.
While not required in the assignment instructions, some potential improvements are:

  • Sending back response codes (i.e. 200 ok)
  • Input validation on the POST endpoint (what if cityName is missing?)

server.get("/", (req, res) => res.send("hello from backend to frontend!"));

server.post("/weather", (req, res) => {
const cityName = req.body.cityName;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good opportunity for object destructuring:

const { cityName } = req.body

@durw4rd durw4rd self-assigned this Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants