Commit cbe750f8043c9fb67333c786af4efce5ec5399d9
1 parent
b78762c8
Exists in
master
and in
38 other branches
Start to build noosfero api service
Showing
3 changed files
with
14 additions
and
10 deletions
Show diff stats
gulp/server.js
| ... | ... | @@ -26,14 +26,7 @@ function browserSyncInit(baseDir, browser) { |
| 26 | 26 | routes: routes |
| 27 | 27 | }; |
| 28 | 28 | |
| 29 | - /* | |
| 30 | - * You can add a proxy to your backend by uncommenting the line below. | |
| 31 | - * You just have to configure a context which will we redirected and the target url. | |
| 32 | - * Example: $http.get('/users') requests will be automatically proxified. | |
| 33 | - * | |
| 34 | - * For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.9.0/README.md | |
| 35 | - */ | |
| 36 | - // server.middleware = proxyMiddleware('/users', {target: 'http://jsonplaceholder.typicode.com', changeOrigin: true}); | |
| 29 | + server.middleware = proxyMiddleware('http://localhost:3000/api', {changeOrigin:true}); | |
| 37 | 30 | |
| 38 | 31 | browserSync.instance = browserSync.init({ |
| 39 | 32 | startPath: '/', | ... | ... |
src/app/components/noosfero/noosfero.service.js
| ... | ... | @@ -3,7 +3,15 @@ |
| 3 | 3 | |
| 4 | 4 | angular.module('angular').service('noosfero', noosfero); |
| 5 | 5 | |
| 6 | - function noosfero() { | |
| 7 | - | |
| 6 | + function noosfero($resource) { | |
| 7 | + this.communities = communities; | |
| 8 | + function communities() { | |
| 9 | + return $resource('/api/v1/communities/:id'); | |
| 10 | + } | |
| 11 | + // this.getBoxes = getBoxes; | |
| 12 | + // function getBoxes() { | |
| 13 | + // return [{id: 1, blocks: [{id: 1, type: 'test'}]}, | |
| 14 | + // {id: 2, blocks: [{id: 2, type: 'test2'}]}]; | |
| 15 | + // } | |
| 8 | 16 | } |
| 9 | 17 | })(); | ... | ... |
src/app/main/main.controller.js