-
Notifications
You must be signed in to change notification settings - Fork 6
Assignments week 2 Ilias Khugaev #11
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 2 Ilias Khugaev #11
Conversation
@@ -0,0 +1,5 @@ | |||
const keys = { | |||
API_KEY: '035094224f6afb540ccce53b0bb98609' |
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.
It is not good practice to push your api key to github as it can lead to unauthorized access to git.
A suggestion would be to add this to your .gitignore
res.status(200).send(responseText); | ||
|
||
} catch (error) { | ||
responseText.weatherText = `${error}`; |
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 suggestion here: Like this you are passing the error object as a response string. this can be dangerous as you dont know what error is being returned. It is better to return a custom message, like Failed to retrieve data from external service
and use a 502 error code (https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/502)
request.get('/') | ||
.expect(200, 'Hello from backend to frontend!', done) | ||
}); | ||
});`` |
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.
`` can be removed here
Really good work at the second assignment! All the requirements are met. Nice job on integrating with the external api. |
No description provided.