Skip to content

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