I have a GRPC service running written in Python. I have the python support proto file for the same.
I want to integrate this backend with AngularJS+Typescript UI.
Questions are:
Is it possible?
Do I have to change anything in the Python grpc server end?
I checked online and it seems Envoy help in doing similar thing, is Envoy the only solution? As I tried a lot and its not working.
What all changes are required.
Yes, gRPC support javascript, you don't need to modify the server, just use service proto generate client javascript files, and use typescript call the function. You need add the grpc-web to your client project. Envoy is not necessary for request server.
Yes, you can integrate gRPC API's with angular(typescript).
follow here it will helpful.
Related
I'm building a React client and a REST server with Django REST framework, neither of which are something I'm particularly good at.
Anyway, on the client side, I find myself writing various calls to fetch, and managing the endpoints and content types, which seems dumb.
I noticed that I can use CoreAPI to build a schema of my API and somehow automagically make an API client.
Can I, and would it be sensible and straitforward, to somehow autobuild that client and inject it into my app, and then call it.
This sounds nice and feasible, but not sure how to go about it, thoughts?
Thanks.
The best library I have found for writing js client for DRF is https://github.com/tulios/mappersmith
I want to know how to work with angularjs without using a backend. I know the option of using $httpBackend and mock, but I want a real life example.
In my team we are considering the possibility of using an express server that simply works with JSON files (no database) If there is no alternative.
Any recommendations? Thanks in advance.
For tests or to begin work when the backend is not ready yet, I often use services to mock REST or SOAP API, such as: www.mockable.io.
Otherwise you can have a simple server to serve static JSON files.
Hi i dont find any related info about this, my question is simple, is there any way
Plugin
Code (Java ,C)
etc
to make a cURL call in an apache cordova app to a custom web service, i know it sound weird but the thing is we have a service from a partner office and they didnt want/know to configure the CORS so i need to make a subservice that call they service via cURL and the send the data to the device, and seems like a lot i want to know if theres any way to achieve that in cordova, i know it cant be done in pure JS but maybe a guide or something to acomplish my goal with java or c will help, regards
Use the following process to setup a proxy service to make the call indirectly:
Use java.net.URL to map the URL
Use java.net.URLConnection to make the connection
Use java.net.Proxy to make a proxy connection
Use the CLI in conjunction with node.js and the ex-curl module for a platform agnostic solution.
References
Networking with Android
Cordova Guide: The Command Line Interface (CLI)
I used Riak(http://basho.com/riak/) as rest service and Angular on client. When I try to use method "PUT" then first request is OPTION, but Riak doesn't know how to properly respond for this.
I found some clients but all of them are made to run on server, not sure about Node.js client like this http://riak-js.org/
Can I make it working from web client?
Maybe Riak was not meant to work with web clients directly, then I'll try something else.
I don't know about Riak, but the OPTIONS request suggests that you're trying to perform a cross-domain request (Angular running on domain "aaa.com", Riak on domain "bbb.com", although it can also even be just a different subdomain or port number).
My guess is that Riak doesn't support CORS, in which case you need to look for an alternative (a simple server-side proxy might be all that you need, although please consider the security impact of exposing Riak directly to browsers).
I have found js gui client for Riak https://github.com/basho/rekon, but it works directly from riak, that's not what i wanted but maybe i can use same solution also, or make proxy on server
I read a couple of posts and presentations on Microservices concept and architecture and REST, and was unable to find answer to a few basic question.
If service A depends on service B, how does sevice A knows where to find (host and port) service B? I'm guessing hardcoding isn't very nice.
If I have, for example, an AngularJS client which request multiple services deployed, how does the angular app knows how to find those multiple services? Again, hardcoding doesn't sound right.
Thank you in advance
AngularJS has Dependency Injection baked in. Use that to construct your dependencies.
If you wanted to reduce the "hard-coding" further, I suppose you could deploy a "Service Registry," which could maintain all of the dependencies. You could then call the Service Registry service to get the port numbers and such, and maintain them in one place. Seems to me like overkill, though.
This is more of a Java based solution to your problem, however it is a very proven method. Take a look at Spring Cloud / Netflix OSS. The Spring Cloud project has a working example on github using AngularJS and the various backend services that make up the Spring Cloud solution.
Specifically the following:
Eureka -> Service Discovery, solves the problem of host and port
Zuul -> HTTP Proxy, solves the problem of finding the current host and port via Eureka integration. Zuul can help with security, CORS etc.
Another possible solution is Zookeeper. I have no experience with Zookeeper.