Skip to content

Read proto files needed to communicate with backend #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
calvellido opened this issue Nov 6, 2017 · 1 comment
Closed

Read proto files needed to communicate with backend #28

calvellido opened this issue Nov 6, 2017 · 1 comment
Assignees
Milestone

Comments

@calvellido
Copy link
Contributor

calvellido commented Nov 6, 2017

The backend server will be presenting the proto files that describe each message or RPC service, through some endpoints, e.g. http://localhost:8080/proto/models/microservices to get the descriptor file of the available nodes and microservices.

To be able to fulfill issues like #13, we need to define a way of getting those proto files and be able to use them, generating the needed code to communicate with freestyle-opscenter backend.

Although we could be directly using them at runtime (thanks to the JS implementation, Protobuf.js) as a really good advantage of using TypeScript and proto files is the chance of getting strongly typed definitions of these messages and services (with all its benefits), the proposal is to read them at build time step on the freestyle-opscenter-webclient.

@calvellido calvellido added this to the Sprint 10 milestone Nov 6, 2017
@calvellido calvellido self-assigned this Nov 6, 2017
@raulraja
Copy link

raulraja commented Nov 6, 2017

A freestyle-rpc service should automatically expose it's .proto definitions via http GET. this GET can happen at build time in the frontend and used to generate a typed client.

calvellido added a commit that referenced this issue Nov 12, 2017
* Add node script to read the proto files on an specific directory and generate the JS code and TS definitions associated.
* Add an example proto which includes a general microservices network structure.
* Add some needed dev dependencies for the node script to work properly.

This fixes #28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants