All Projects → portable-cto → Airtable Proxy Worker

portable-cto / Airtable Proxy Worker

A Cloudflare Worker that allows you to make secure requests to the Airtable API from your frontend.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Airtable Proxy Worker

Bhadoo Cloud
Directly Upload to Google Drive from Torrent or URLs
Stars: ✭ 136 (+56.32%)
Mutual labels:  proxy, cloudflare
Cloudflare Cors Anywhere
CORS "anywhere" proxy in a Cloudflare worker. DEMO at: https://test.cors.workers.dev/
Stars: ✭ 162 (+86.21%)
Mutual labels:  proxy, cloudflare
Flaresolverr
Proxy server to bypass Cloudflare protection
Stars: ✭ 241 (+177.01%)
Mutual labels:  proxy, cloudflare
Cloudflare Cname Setup
Cloudflare Partner Panel
Stars: ✭ 1,169 (+1243.68%)
Mutual labels:  cloudflare
Hexoplusplus
🎁基于CloudFlareWorker的无服务器Hexo后端,目标:解决静态博客所有痛点[文章编辑、图片上传、博主活跃信息统计、博主说说、Twikoo加强版、阅读量统计【尚未完成】]
Stars: ✭ 72 (-17.24%)
Mutual labels:  cloudflare
Docker Nginx Image Proxy
on the fly image cropping with gravity, resize and compression microservice
Stars: ✭ 79 (-9.2%)
Mutual labels:  proxy
Aws Lambda Go Proxy
⚡️ ☁️ Pass Lambda events to the application running on your machine | Debug real traffic locally | Forget about redeployments
Stars: ✭ 85 (-2.3%)
Mutual labels:  proxy
Cloudflare Dyndns
CloudFlare Dynamic DNS client
Stars: ✭ 69 (-20.69%)
Mutual labels:  cloudflare
Cloudfail
Utilize misconfigured DNS and old database records to find hidden IP's behind the CloudFlare network
Stars: ✭ 1,239 (+1324.14%)
Mutual labels:  cloudflare
Bdtunnel
BoutDuTunnel is able to create virtual connections tunnelled in HTTP requests.
Stars: ✭ 78 (-10.34%)
Mutual labels:  proxy
Foxman
🍥 an extensible mock server
Stars: ✭ 76 (-12.64%)
Mutual labels:  proxy
Tcptunnel
将本地内网服务器映射到公网。
Stars: ✭ 72 (-17.24%)
Mutual labels:  proxy
Venom
Venom - A Multi-hop Proxy for Penetration Testers
Stars: ✭ 1,228 (+1311.49%)
Mutual labels:  proxy
Doh
🍩 DNS over HTTPs command-line client
Stars: ✭ 70 (-19.54%)
Mutual labels:  cloudflare
File Proxy
文件代下载服务,github文件加速下载,支持任意文件格式。支持命令行代下,支持子节点权重负载均衡。
Stars: ✭ 82 (-5.75%)
Mutual labels:  proxy
Tor Router
A SOCKS, HTTP and DNS proxy for distributing traffic across multiple instances of Tor
Stars: ✭ 69 (-20.69%)
Mutual labels:  proxy
Hooman
http interceptor to hoomanize cloudflare requests
Stars: ✭ 82 (-5.75%)
Mutual labels:  cloudflare
Whistle
HTTP, HTTP2, HTTPS, Websocket debugging proxy
Stars: ✭ 9,683 (+11029.89%)
Mutual labels:  proxy
Free proxy ss
分享来自互联网上免费的shadowsocks(SS)/ShadowsocksR(SSR)/V2ray(vmess)代理 每15分钟更新一次,每次各分享4个临时可用代理。 及时订阅、及时更新。
Stars: ✭ 72 (-17.24%)
Mutual labels:  proxy
Lightsocks Nodejs
It's a simple socks5 proxy tool which based on lightsocks
Stars: ✭ 79 (-9.2%)
Mutual labels:  proxy

Airtable Proxy Cloudflare Worker

A Cloudflare Worker that allows you to make secure requests to the Airtable API from your frontend.

Travis Build Status Coverage Status Code Style: Prettier GitHub stars License

Features

  • Keep your Airtable Base ID and API Key secret while still allowing frontend apps to access data from Airtable's API.
  • Limit requests to specific methods and tables. For example, using this library, you can make sure that public users can only make GET requests to your tables.
  • Automatically build and push updates to your Cloudflare Worker using Travis-CI.

Usage

Prerequisites

Building Locally

The easiest way to see this project in action is to build your Worker locally and copy/paste it into Cloudflare's UI:

  • Clone this repo: git clone https://github.com/portable-cto/airtable-proxy-worker.git
  • Install dependencies: npm install
  • Build the worker with your Airtable App/Base ID and API Key: AIRTABLE_API_BASE_ID=appXXXXXXXXX AIRTABLE_API_KEY=keyXXXXXXXXXX npm run build
  • Upload the built dist/worker.js file to cloudflareworkers.com to test your script.

Your Airtable's tables will be available via the table name. For example, if my Airtable base has a table name posts, it would be available at https://tutorial.cloudflareworkers.com/posts.

In order to deploy the worker to your own personal worker, upload it via the web UI and click "Deploy".

Routing

By default, the routes for each of your tables are available at YOUR_CLOUDFLARE_DOMAIN/RESOURCE_NAME. For example, if my custom domain is http://api.example.com and the table I want to access is called users, I would access the API at http://api.example.com/users.

You can change this routing using a PROXY_PREFIX as described in the Configuration section below.

Automated Deployment

You can also use Travis to automatically deploy updates to your Worker. Just add the following environment variables to your Travis settings:

  • CLOUDFLARE_EMAIL
  • CLOUDFLARE_AUTH_KEY
  • CLOUDFLARE_ZONE_ID
  • AIRTABLE_API_BASE_ID
  • AIRTABLE_API_KEY

The deploy block in the .travis.yml file will automatically update your worker in Cloudflare when the master branch is built using the script at scripts/deploy.

Configuration

In addition to the required AIRTABLE_API_KEY and AIRTABLE_API_BASE_ID variables, you can also set the following configuration options as ENV vars:

  • AIRTABLE_API_URL - Defaults to https://api.airtable.com.
  • AIRTABLE_API_VERSION - Defaults to v0.
  • PROXY_PREFIX - Use this if your Cloudflare worker's routes are prefixed by something before the Airtable resource name. For example, you may want to call mycustomdomain.com/api/posts instead of mycustomdomain.com/posts. In this example, you would add api as a prefix.
  • ALLOWED_TARGETS - Use this to lock down your Airtable API to specific resources and methods. For example, a stringified JSON object like this: '[{"resource":"posts","method":"GET,PUT"},{"resource":"comments","method":"*"}]' will allow GET and PUT requests on the posts resource and all request methods on the comments resource. Allows all methods for all resources by default.
  • PROXY_CACHE_TIME - Defaults to 0. The number of seconds set on the Cache-Control header to use Cloudflare's caching.

Contributing

Contributions are welcome and encouraged! When contributing to this repository, please first discuss the change you wish to make via the issues on Github.

Testing

Before you make a pull request, please add or update any relevant tests. You can run the test suite (uses Jest): npm run test:local

Also run Prettier to ensure that code styling is consistent: npm run prettier.

Pull Request Process

  1. Make sure tests are running and linting passes before you submit a PR.
  2. Update any relevant parts of the documentation in the readme.md file.
  3. Update the changelog.md file with any new updates, breaking changes, or important notes.
  4. Run the build process to make sure it passes too: npm run build.
  5. Include a link to any relevant issues in the PR on Github. If there are problems with your PR, we will discuss them in Github before merging.

Releases

This library uses semantic versioning to inform users of breaking and non-breaking changes. When a new release is ready, the following steps will be taken:

  • Make sure tests still pass: npm test.
  • Run the release script: npm version <SEMANTIC_VERSION> && git push --tags with the release number you want to use.

This will create a new Tag in Github.

License

The MIT License (MIT)

Copyright (c) 2018 Portable CTO, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].