## gRPC-web example PostgRPC supports [`gRPC-web`](https://grpc.io/docs/platforms/web/basics/#why-grpc) when it's compiled with the `web` feature flag. This flag is disabled by default, but can be enabled during installation or compilation through `cargo`'s [`--features`](https://doc.rust-lang.org/cargo/reference/features.html#features) flag. ### Pre-requisites - [`docker-compose`](https://docs.docker.com/compose/) - a clone of this repo (i.e. `git clone git@github.com:boilerplatter/postgrpc.git`) - a browser with [gRPC-web devtools](https://chrome.google.com/webstore/detail/grpc-web-developer-tools/kanmilmfkjnoladbbamlclhccicldjaj) enabled (optional) for tracking in-flight gRPC requests. - [`protoc`](https://grpc.io/docs/protoc-installation/) (optional) for compiling file descriptors ### Getting Started This example uses [`docker-compose`](https://docs.docker.com/compose/) to spin a web server and a `web`-enabled build of PostgRPC. From this directory, `docker-compose up` starts the example application. Once all services have been built, you can visit `http://localhost:8080` in your browser to see in-flight gRPC requests for data from the `postgrpc` service. ### Building gRPC-web Clients In this example, the `app` clients have already been compiled into the `app/clients` directory. To compile them again, you can use the `proto` script from the `app` directory via `npm install` followed by `npm run proto`. ### Security Disclaimer DO NOT expose a `web`-enabled PostgRPC service to the public web without additional security measures! For examples of how to lock down a database for "public" consumption, take a look at the [`auth` example](../auth).