Skip to content

nrdcp/nrdcp-api

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

954ecb6 · Sep 12, 2020

History

3 Commits
Apr 21, 2020
Apr 21, 2020
Apr 21, 2020
Apr 21, 2020
Apr 21, 2020
Sep 12, 2020
Apr 21, 2020
Apr 21, 2020

Repository files navigation

nrdcp GraphQL API

credentials

check correct project is set with gcloud config list project if not, update with export GOOGLE_CLOUD_PROJECT=$(gcloud config get-value core/project)

associate with service account (needs at least BigQuery User and Viewer permissions) export GOOGLE_APPLICATION_CREDENTIALS=/Users/${USER}/gcp/keys/big-query-api-key.json

run locally

install dependencies npm install run server npm start navigate to http://localhost:8080/graphql

available data

latest Home Sensor reading (SQL query directly on BiqQuery)

query {
  latestSensorReading {
    temperature,
    humidity,
    timestamp
  }
}

build image

gcloud builds submit --tag gcr.io/$GOOGLE_CLOUD_PROJECT/nrdcp-api

deploy

gcloud run deploy nrdcp-api \
  --image gcr.io/$GOOGLE_CLOUD_PROJECT/nrdcp-api \
  --platform managed \
  --region us-central1 \
  --allow-unauthenticated

TODO

  • Logging
  • Cloudbuild from git hash

About

GraphQL API for personal projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published