Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nathanwaters/hasura-cloudflare-worker
Example Cloudflare Worker for Facebook-based authorization and GraphQL proxy queries with Hasura
https://github.com/nathanwaters/hasura-cloudflare-worker
cloudflare-worker cloudflare-workers facebook-login graphql hasura hasura-graphql
Last synced: 6 days ago
JSON representation
Example Cloudflare Worker for Facebook-based authorization and GraphQL proxy queries with Hasura
- Host: GitHub
- URL: https://github.com/nathanwaters/hasura-cloudflare-worker
- Owner: nathanwaters
- License: mit
- Created: 2018-11-21T22:22:22.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-21T22:55:09.000Z (almost 6 years ago)
- Last Synced: 2024-08-01T16:34:56.460Z (3 months ago)
- Topics: cloudflare-worker, cloudflare-workers, facebook-login, graphql, hasura, hasura-graphql
- Language: JavaScript
- Size: 10.7 KB
- Stars: 18
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cloudflare - Hasura - Example using Facebook-based authorization and graphql proxy queries with hasura. (Workers / Recipes)
- awesome-cloudflare - Hasura - Example using Facebook-based authorization and graphql proxy queries with hasura. (Workers / Recipes)
README
# Hasura Cloudflare Worker
Example Cloudflare Worker using Facebook-based authorization and GraphQL proxy queries with Hasura.
## Prerequisites
1. [Cloudflare](https://www.cloudflare.com/products/cloudflare-workers/) account with Workers enabled ($5/mth minimum).
2. [Hasura](https://hasura.io/) GraphQL endpoint setup with `person` table, auth webhook (for GQL subscriptions) and [permissions](https://docs.hasura.io/1.0/graphql/manual/auth/basics.html) set on the `fb_id` plus a user `role` column.## Install
1. Add config variables in .env
2. Run `npm install`
3. Run `npm run build`
4. Copy dist/worker.js code into Cloudflare Worker web UI
5. Save and test with [Insomnia](https://insomnia.rest/)