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.
- Host: GitHub
- URL: https://github.com/yukigeshiki/rocket-webservice-test-rust
- Owner: Yukigeshiki
- License: mit
- Created: 2022-11-04T07:53:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T08:41:55.000Z (about 2 years ago)
- Last Synced: 2025-04-10T14:33:00.035Z (about 1 year ago)
- Topics: cloudrun, gcp, graphql, mongodb, rocket, rust, serverless, webservice
- Language: Rust
- Homepage:
- Size: 136 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.