-
Notifications
You must be signed in to change notification settings - Fork 6
Assignments week 1 Oleksandr Starshynov #2
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
base: main
Are you sure you want to change the base?
Assignments week 1 Oleksandr Starshynov #2
Conversation
It looks strange, I know. For some reason, I didn't see PR for first and second commits. So I was able to push the work only with third commit, but here I see all three of then. |
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.
A strong first attempt, and your newly made API requests return exactly what is required.
I have requested the following changes:
- You need to use the express-handlebars templating package.
- I would recommend checking out the "Usage" paragraph here https://www.npmjs.com/package/express-handlebars for advice on how to set this up.
Good luck!
"description": "", | ||
"dependencies": { | ||
"express": "^5.1.0", | ||
"express-handlebars": "^8.0.2", |
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.
While you have imported the handlebars templating system, you have not used it in the assignment, please implement/use this for templating/displaying the response to the root ("/") GET request. as a hint, your return line should look like 'res.render('home')'
"express": "^5.1.0", | ||
"express-handlebars": "^8.0.2", | ||
"node-fetch": "^3.3.2" | ||
}, |
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.
(Minor,non-blocking) we are missing the use of the nodemon package
- Add it to the dev-dependancies.
Can you add a line to the "scripts" option showing how you would run nodemon
Adding your "run" commands to the script's options has two main benefits:
-> It enables easier collaboration between teammates, as everyone on the team uses the same commands.
-> It saves time rather than having to remember and write out (sometimes long) commands.
app.post('/weather', (req, res) => { | ||
const cityName = req.body.cityName; | ||
console.log('Received city name:', cityName); | ||
res.send(`You sent: ${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.
Replace this with an express-handlebars rendered page.
No description provided.