Config and login
Change-Id: I81ffb9b8097620cb7870beaf1b1b315945eebec0
diff --git a/src/app/services/rest/core.service.ts b/src/app/services/rest/core.service.ts
new file mode 100644
index 0000000..04097a6
--- /dev/null
+++ b/src/app/services/rest/core.service.ts
@@ -0,0 +1,31 @@
+/// <reference path="../../../../typings/index.d.ts"/>
+
+// Imports
+import {AppConfig} from '../../config/app.config';
+import { Injectable } from '@angular/core';
+import { Http, Response, Headers, RequestOptions } from '@angular/http';
+import {Observable} from 'rxjs/Rx';
+
+// Import RxJs required methods
+import 'rxjs/add/operator/map';
+import 'rxjs/add/operator/catch';
+
+@Injectable()
+export class CoreService {
+ // Resolve HTTP using the constructor
+ constructor (private http: Http) {}
+ // private instance variable to hold base url
+ private baseUrl = AppConfig.apiEndpoint;
+
+ // Fetch all existing comments
+ getCoreEndpoints() : Observable<any[]> {
+
+ // ...using get request
+ return this.http.get(`${this.baseUrl}/core/`)
+ // ...and calling .json() on the response to return data
+ .map((res:Response) => res.json())
+ //...errors if any
+ .catch((error:any) => Observable.throw(error.json().error || 'Server error'));
+
+ }
+}