Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Narpimers
Copy link

No description provided.

@@ -0,0 +1,5 @@
const keys = {
API_KEY: '035094224f6afb540ccce53b0bb98609'

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}`;

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)
});
});``

Choose a reason for hiding this comment

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

`` can be removed here

@Pandelissym
Copy link

Really good work at the second assignment! All the requirements are met. Nice job on integrating with the external api.
I left a few suggestions!

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