diff --git a/src/client/api/APIDocument.js b/src/client/api/APIDocument.js new file mode 100644 index 00000000..ccc65a0f --- /dev/null +++ b/src/client/api/APIDocument.js @@ -0,0 +1,8 @@ +import EndPoint from './EndPoint'; + +export default class APIDocument extends EndPoint { + awards() { + let url = '/documents/awards'; + return this.request.get(url, {cache: true}); + } +} \ No newline at end of file diff --git a/src/client/api/EndPoint.js b/src/client/api/EndPoint.js new file mode 100644 index 00000000..4e5b0b59 --- /dev/null +++ b/src/client/api/EndPoint.js @@ -0,0 +1,5 @@ +export default class EndPoint{ + constructor(http){ + this.request = http; + } +} \ No newline at end of file diff --git a/src/client/api/api.js b/src/client/api/api.js index c51f7292..96ccdde5 100644 --- a/src/client/api/api.js +++ b/src/client/api/api.js @@ -4,14 +4,16 @@ var APINews = require("./news"); var APIGallery = require("./gallery"); +import APIDocument from './APIDocument'; -module.exports = function(app) { +module.exports = function (app) { var minute = 1000 * 60; app.factory("api", function ($http) { var api = {}; api.news = new APINews($http); api.gallery = new APIGallery($http, minute); + api.document = new APIDocument($http); return api; });