cognoma / frontend

Frontend for Project Cognoma
http://cognoma.org/
Other
4 stars 22 forks source link

Angular Service creation: Cognoma Core-Service API intergation #28

Closed bdolly closed 7 years ago

bdolly commented 7 years ago

Create a service that communicates with the Cognoma Core-Services API.

@cgreene @awm33 I see endpoints documented but I'm not sure what the base API url is or if there is one or if the core-services can be spun up locally to interact with during development. Some guidance here would be appreciated as the back-end stack is outside my area of expertise.

awm33 commented 7 years ago

@bdolly There is no base URL yet. We were thinking https://cognoma.org/api but it could also be a subdomain like https://api.cognoma.org

There is some guidance on how to run the API server locally in the README. I'm working on docker setup which should make that much easier. Docker compose should set up nginx, core-service, task-service, and postgres. Potentially elasticsearch as well.

Development should be done locally and not against production, so being able to change the API base url through the environment or as part of a gulp task would be nice.

This angular service should also be mocked, so unit and integration tests can run without the entire application running.

The tests are the best example of usage so far, though it may be hard from frontend devs to interrupt the python.

dhimmel commented 7 years ago

@awm33 do you prefer https://cognoma.org/api or https://api.cognoma.org? Does one option provide us more flexibility or hosting modularity?

Is it the case that our frontend code is all static? For example, we could host it using GitHub Pages? In that case, I think we'd want to use https://api.cognoma.org since the API cannot be hosted on GitHub Pages.

awm33 commented 7 years ago

@dhimmel I think I would prefer https://api.cognoma.org. I don't think we can use Github Pages since we can't set Cross Origin Resource Sharing headers.

We could host the static frontend using nginx or even just S3, which supports setting CORS headers and is almost maintance free.

For local development, some sort of web server would be needed, but it looks like the repo already has a gulp task for that.

dhimmel commented 7 years ago

Okay then let us go with https://api.cognoma.org.

bdolly commented 7 years ago

closed with #51