How I can test from browser (like from swagger) my webapp powered by gRPC-Web without REST? - swagger

I want to develop my client-server web app with clear gRPC (gRPC-Web) without REST. Something like described at official doc: https://grpc.io/docs/quickstart/web.html
Is it exist any tool like swagger that let me view message formats from .proto and test the server methods by sending any messages from the browser?
I use node.js for server side app

You could use https://kreya.app, which is a gRPC GUI client and supports gRPC-Web. Note that it requires an installation.
Disclaimer: I'm one of the authors of Kreya.

The gRPC-Web wire protocol is a binary format and is basically human-unreadable. There is an enhancement request to prettify it https://github.com/grpc/grpc-web/issues/317 but we haven't got around to it.

If you are ok with talking to your gRPC backend directly without gRPC web, there are a few CLI and GUI tools for that purpose:
CLI: The official tool grpc-cli
CLI: grpCurl
GUI: (this requires a golang backend unfortunately): grpc-json-proxy
GUI: omgrpc

Found this pretty tool for test my gRPC-backend directly (without gRPC-Web): https://github.com/uw-labs/bloomrpc

Related

Orocommerce - generate API client libraries

I am quite new in the orocommerce ecosystem, and I would like to generate API client librairies automatically for orocommerce API (frontend and backend). The objective is to build my own UI.
I found some dependencies on NelmioApiDocBundle than could potentially generate swagger file, but I hit multiple problems:
this is a quite old version, that only support swagger 1.2
the generated file (using symfony run php bin/console api:swagger:dump /tmp/api/) seems not working with swagger codegen "as is"
all the part of the API seems not written using NelmioApiDocBundle annotation
I am wondering if there is an other mechanism to generate API client librairies for orocommerce. I would like a SDK for typescript.
Thanks in advance for your answer.
Right now, the only supported swagger version is 1.2, as you stated.
By default, the api:swagger:dump command works with an outdated API, to generate data for the current API, run it with --view=rest_json_api option:
api:swagger:dump --view=rest_json_api
As an alternative to the API client generation, as Oro API strictly follows JSON.API standard, you can use many existing client libraries, compatible with the JSON.API specification. The list of Typescript implementations can be found at the official website: https://jsonapi.org/implementations/#client-libraries-typescript

Hyperledger Composer: Where is the Open API Specification generated by composer-rest-server stored?

I want to use the specification in to generate a Java client using swagger codegen in order to consume the REST API from a Java application. Where do I find the Open API spec after I start the composer-rest-server? I've tried looking it up but I can't figure out where that file is stored after it is generated.
By default, the docs are at your localhost:3000/explorer
This is generated automatically by the LoopBack framework.
You should carefully follow: https://hyperledger.github.io/composer/integrating/getting-started-rest-api.html

how can I create my own plugin for mosquitto broker?

How can I make a plugin like mosquitto-auth-plug for authorization, or one for storing message payloads or other usages?
Should I write it in C or can I use python?
Any plugin for mosquitto is going to have to be written in something that can be compiled to a native shared library that can be loaded by mosquitto. This would normally mean C or C++
There are hooks in place for the authentication plugin, but none for message storage or anything else so that is unlikely to work without modifying mosquitto directly.
You should examine the code for the auth-plugin and for mosquitto for details.
You could look into C (works for me)
https://github.com/hadleyrich/mosquitto-auth-plugin-http
and In Python
(not tested , but working for other folks)
https://github.com/mbachry/mosquitto_pyauth

Dartium and it's use of dart:io

I am building a feature-rich standalone application using dart. I picked dart since it seemed to allow not only the standard development approach for webapps but also to access system resources (such as nodejs does). One of my requirements is file io or database access (which again requires file io). Dartium however does not allow the use of the dart:io package (only in servermode is this library accessible). Can anybody think of a workaround, a change to the dart environment or the chromium environment to allow this ? Maybe a custom compiled dartVM in the browser environemnt.
Basically a way to use database connections in a dart standalone app. A REST wrapper is only an option if this code could get generated automatically.
I am not clear if such a thing is possible or if chromium will prevent any approach to access system resources.
Yes in standalone mode dart you can use files, and also TCP socket, and web socket.
So you can connect to databases. (for example to MySQL: https://github.com/jamesots/sqljocky)
In browser mode you can use built-in databases dart:indexed_db or dart:web_sql.
You can also use web-socket protocol
Maybe you can use websocket to connect with local or remote database.

Possible to deploy WAR via Dreamweaver CS5?

I use Dreamweaver heavily for modifying Liferay templates (Velocity files), and then have to run Apache Ant from Command Prompt to deploy the WAR to Tomcat . Is there anyway I can streamline this process so I can save/deploy straight from Dreamweaver?
I tried to setup a site and specify Tomcat as the local server, but obviously Dreamweaver just tries to push the raw file and does deploy the WAR.. Is there some sort of extension or way I can call Apache Ant from Dreamweaver?
Thanks!
I've not seen such an extension, you can search for one at the Adobe Exchange: http://www.adobe.com/go/exchange , however if there isn't one already available, which I suspect there isn't, it would be possible to write one of your own. The following links are for the extending Dreamweaver, and Dreamweaver extensibility APIs:
http://help.adobe.com/en_US/dreamweaver/cs/extend/index.html
http://help.adobe.com/en_US/dreamweaver/cs/apiref/index.html
In this particular case, I believe that you'd need to use an undocumented API call to communicate with an external process (in your case Ant), such as DWfile.runCommandLine() or MM.runCommandLine(). Paul Boon found these and blogged about them and a couple of others here:
http://communitymx.com/blog/index.cfm?newsid=179&blogger=35

Resources