-
Notifications
You must be signed in to change notification settings - Fork 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
Oleksandr Week 1 Node JS #7
base: main
Are you sure you want to change the base?
Oleksandr Week 1 Node JS #7
Conversation
package.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems the file structure got a bit mingled - the package.json file is outside of the app folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right, I have to use unique package.json for each app, and not one package.json for all the apps.
|
||
app.post("/weather", (req, res) => { | ||
const cityName = req.body.cityName; | ||
res.json({ cityName }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't look into the assignments for the upcoming weeks yet so I don't know in which direction this project evolves. Nothing wrong with using the res.json()
method for now, just be aware there is also the more versatile option res.send()
if you need/want to send other data types: https://www.geeksforgeeks.org/difference-between-res-send-and-res-json-in-express/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done, Oleksandr!
No description provided.