-
Notifications
You must be signed in to change notification settings - Fork 13
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
load movies/series details from an external api #55
Changes from all commits
38065d1
75c6e15
c5422ba
d9fb751
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const fetch = require('node-fetch'); | ||
|
||
var TVMazeService = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also out of curiousity, why not use let? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could also be a constant, since it doesn't get modified. In the beginning, I tried to keep it ES5 only, but looking at the project currently, it already is a mix between |
||
loadDataByName: loadDataByName | ||
} | ||
|
||
function loadDataByName(showName) { | ||
return fetch("http://api.tvmaze.com/search/shows?q="+ showName) | ||
.then((response) => response.json()) | ||
.catch((err) => console.error(err)) | ||
} | ||
|
||
module.exports = TVMazeService; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Should this be a const?
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, this could be a
const
, but that's not a deal breaker.