Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guillempuche/app-curriculum-serverless-cloudflare-worker
Serverless to retrieve data from a Supabase database using Cloudflare Workers
https://github.com/guillempuche/app-curriculum-serverless-cloudflare-worker
cloudflare cloudflare-workers faas function-as-a-service serverless supabase worker
Last synced: 5 days ago
JSON representation
Serverless to retrieve data from a Supabase database using Cloudflare Workers
- Host: GitHub
- URL: https://github.com/guillempuche/app-curriculum-serverless-cloudflare-worker
- Owner: guillempuche
- Created: 2023-09-06T20:20:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-20T10:10:20.000Z (8 months ago)
- Last Synced: 2025-02-07T07:14:25.765Z (6 days ago)
- Topics: cloudflare, cloudflare-workers, faas, function-as-a-service, serverless, supabase, worker
- Language: TypeScript
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cloudflare Worker or Function as a Services (Faas)
This project is a FaaS deployed on Cloudflare.
The function is used in the mobile app and web app [App Curriculum](https://github.com/guillempuche/app_curriculum).
## Run the worker locally
> You could need creating a Cloudflare Worker on Cloudflare website.
1. Open the project in your terminal, and install the packages running this command `npm i`.
2. Create the secret local environment variables in a new file on the root directory of this project called `.dev.vars` with the next code:```
SUPABASE_URL=replace_with_your_base_url
SUPABASE_KEY=replace_with_your_key
```3. Run locally the worker `npx wrangler dev` or `npm start`.
4. Open a browser tab at http://localhost:8787/ to see your worker in action
5. Run `npx wrangler deploy` or `npm run deploy` to publish your workerIf you deploy the worker, you'll also need to create the secret environment variables on the Cloud. Hence, follow this tutorial ([tutorial here](https://developers.cloudflare.com/workers/configuration/environment-variables/)).
## Resources
- Cloudflare Workers https://developers.cloudflare.com/workers/
- Cloudflare Wrangler or CLI https://developers.cloudflare.com/workers/wrangler
- Workers configuration file `wrangler.toml` in https://developers.cloudflare.com/workers/wrangler/configuration/ and https://developers.cloudflare.com/workers/configuration/sites/configuration/
- Code examples https://github.com/cloudflare?q=worker&type=all&language=javascript