+ EndPoint, APIDocument

This commit is contained in:
tmshv committed 2016-02-20 16:43:50 +03:00
1 parent 5640acdd81
commit ce2d0ec1b9
3 files changed
+16 -1

No files matched your search

+8
View File
@@ -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});
}
}
+5
View File
@@ -0,0 +1,5 @@
export default class EndPoint{
constructor(http){
this.request = http;
}
}
+3 -1
View File
@@ -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;
});