diff --git a/gulp/server.js b/gulp/server.js index 500b0c0..b4b6a64 100644 --- a/gulp/server.js +++ b/gulp/server.js @@ -26,14 +26,7 @@ function browserSyncInit(baseDir, browser) { routes: routes }; - /* - * You can add a proxy to your backend by uncommenting the line below. - * You just have to configure a context which will we redirected and the target url. - * Example: $http.get('/users') requests will be automatically proxified. - * - * For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.9.0/README.md - */ - // server.middleware = proxyMiddleware('/users', {target: 'http://jsonplaceholder.typicode.com', changeOrigin: true}); + server.middleware = proxyMiddleware('http://localhost:3000/api', {changeOrigin:true}); browserSync.instance = browserSync.init({ startPath: '/', diff --git a/src/app/components/noosfero/noosfero.service.js b/src/app/components/noosfero/noosfero.service.js index 6d1fa36..683224a 100644 --- a/src/app/components/noosfero/noosfero.service.js +++ b/src/app/components/noosfero/noosfero.service.js @@ -3,7 +3,15 @@ angular.module('angular').service('noosfero', noosfero); - function noosfero() { - + function noosfero($resource) { + this.communities = communities; + function communities() { + return $resource('/api/v1/communities/:id'); + } + // this.getBoxes = getBoxes; + // function getBoxes() { + // return [{id: 1, blocks: [{id: 1, type: 'test'}]}, + // {id: 2, blocks: [{id: 2, type: 'test2'}]}]; + // } } })(); diff --git a/src/app/main/main.controller.js b/src/app/main/main.controller.js index c07be92..da1714b 100644 --- a/src/app/main/main.controller.js +++ b/src/app/main/main.controller.js @@ -12,6 +12,9 @@ activate(); function activate() { + var profile = noosfero.communities().get({id: 67, private_token: '1b00325e5f769a0c38550bd35b3f1d64'}, function () { + console.log(profile); + }); // vm.boxes = noosfero.getBoxes(); } } -- libgit2 0.21.2