Skip to content

Instantly share code, notes, and snippets.

@martijnwalraven
Last active June 19, 2018 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martijnwalraven/9cfce0e6b095b9ef611ec357d293b432 to your computer and use it in GitHub Desktop.
Save martijnwalraven/9cfce0e6b095b9ef611ec357d293b432 to your computer and use it in GitHub Desktop.
class PersonalizationAPI extends RESTDataSource {
baseURL = 'https://personalization-api.example.com';
willSendRequest(request: Request) {
request.headers.set('Authorization', this.context.token);
}
async getFavorites() {
return this.get('favorites');
}
async getProgressFor(movieId: string) {
return this.get('progress', {
id: movieId,
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment