Skip to content

Hossein-w1-node.js #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hossein-Kelisa
Copy link

I add server.js , install npm ( package.json) and test with Postman

Copy link

@eidosam eidosam left a comment

Choose a reason for hiding this comment

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

Well done, Hossein! You did a great job on this assignment. The code is clean and well organized.

Keep up the good work!

"start": "node server.js"
},
"keywords": [],
"author": "",
Copy link

Choose a reason for hiding this comment

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

Consider adding your name and public email to the author field, in the format: Name <email-address>. It's good practice, though not required.

});

app.post('/weather', (req, res) => {
res.send(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.

Best practice is to destructure values from req.body for improved code readability:

const { cityName } = req.body;
res.send(cityName);

@eidosam eidosam added Approved Week 1 Week 1 assignment and removed Review in progress labels Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Week 1 Week 1 assignment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants