An open API service indexing awesome lists of open source software.

https://github.com/yukigeshiki/rocket-webservice-test-rust

Experimenting with the Rocket framework and GCP Cloud Run. Includes a GraphQL implementation and a MongoDB integrations branch.
https://github.com/yukigeshiki/rocket-webservice-test-rust

cloudrun gcp graphql mongodb rocket rust serverless webservice

Last synced: about 2 months ago
JSON representation

Experimenting with the Rocket framework and GCP Cloud Run. Includes a GraphQL implementation and a MongoDB integrations branch.

Awesome Lists containing this project

README

          

# rocket-webservice-test-rust
A basic web service template for Rust using the Rocket framework and tested with GCP Cloud Run.

For a GraphQL implementation, checkout the `feat/graphql` branch.

For a MongoDB integrations example, checkout the `feat/db-integrations` branch. I'll be adding more database integration
examples to this branch at a later stage as well.

#### To deploy to Cloud Run:

Export variables

```bash
export PROJECT_ID=
export SERVICE_NAME=
export SERVICE_ACC=
export REGION=
```

Substitute values and run Cloud Build file

```bash
cp ./cloudbuild.yaml ./cloudbuild_copy.yaml && \
sed -i '' -e "s//${PROJECT_ID}/" \
-e "s//${SERVICE_NAME}/" \
-e "s//${SERVICE_ACC}/" \
-e "s//${REGION}/" ./cloudbuild_copy.yaml && \
gcloud builds submit --config ./cloudbuild_copy.yaml && \
rm ./cloudbuild_copy.yaml
```

The permissions needed for the Cloud Build and Cloud Run service accounts can be found in the README of [this](https://github.com/Yukigeshiki/gcp-cloud-run-deploy-rust)
repo.