All Projects → anderly → cloudflare-worker-routing

anderly / cloudflare-worker-routing

Licence: MIT license
A simple Cloudflare Worker with built-in routing

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to cloudflare-worker-routing

cloudflare-worker-app-kit
☁✨ A handy set of tools for creating a Cloudflare Worker app.
Stars: ✭ 75 (+97.37%)
Mutual labels:  cloudflare, cloudflare-worker
worker-kv
Rust bindings to Cloudflare Worker KV Stores
Stars: ✭ 36 (-5.26%)
Mutual labels:  cloudflare, cloudflare-worker
telegram-bot-api-worker
Take an alternate route to Telegram Bot API :)
Stars: ✭ 75 (+97.37%)
Mutual labels:  cloudflare, cloudflare-worker
cloudflare-worker-router
A super lightweight router (1.3K) with middleware support and ZERO dependencies for CloudFlare Workers.
Stars: ✭ 144 (+278.95%)
Mutual labels:  cloudflare, cloudflare-worker
cloudflare-ddns
A script to update your Cloudflare DNS records at a glance.
Stars: ✭ 152 (+300%)
Mutual labels:  cloudflare, cloudflare-api
CloudflareCustomPages
My Cloudflare Custom Pages ,It is Beautiful!
Stars: ✭ 35 (-7.89%)
Mutual labels:  cloudflare, cloudflare-api
DNS-over-Discord
A 1.1.1.1 DNS resolver built for Discord
Stars: ✭ 228 (+500%)
Mutual labels:  cloudflare, cloudflare-worker
IPFS PHOTO SHARE
💰用甚嚒服务器,ServerLess搭建一个图片分享站点!| 基于CloudFlareWorker无服务器函数和IPFS去中心化存储的图片分享网站
Stars: ✭ 76 (+100%)
Mutual labels:  cloudflare, cloudflare-worker
detect-cloudflare-plus
True Sight Firefox extension.
Stars: ✭ 34 (-10.53%)
Mutual labels:  cloudflare
inkrss
Notify when rss feeds are updated | RSS 更新通知
Stars: ✭ 234 (+515.79%)
Mutual labels:  cloudflare
kubeflare
A Kubernetes Operator to manage Cloudflare settings via a declarative Kubernetes API
Stars: ✭ 50 (+31.58%)
Mutual labels:  cloudflare
flarequench
Burp Suite plugin that adds additional checks to the passive scanner to reveal the origin IP(s) of Cloudflare-protected web applications.
Stars: ✭ 44 (+15.79%)
Mutual labels:  cloudflare
nebula
Source Code for the Home Server setup.
Stars: ✭ 48 (+26.32%)
Mutual labels:  cloudflare
Projectsv2
Google Analytics + Cloudflare+ Firebase + Projects Website+ Bugs
Stars: ✭ 10 (-73.68%)
Mutual labels:  cloudflare-api
cfw-easy-utils
An in-depth library to assist with common tasks with CF Workers. Includes utils for responses, cookies, and more!
Stars: ✭ 52 (+36.84%)
Mutual labels:  cloudflare
slshx
⚔️ Strongly-typed Discord commands on Cloudflare Workers
Stars: ✭ 163 (+328.95%)
Mutual labels:  cloudflare
scrapy-cloudflare-middleware
A Scrapy middleware to bypass the CloudFlare's anti-bot protection
Stars: ✭ 84 (+121.05%)
Mutual labels:  cloudflare
worker-auth-providers
worker-auth-providers is an open-source providers to make authentication easy with workers. Very lightweight script which doesn't need a lot of dependencies. Plug it with any framework or template of workers.
Stars: ✭ 85 (+123.68%)
Mutual labels:  cloudflare
warpy
A command-line program to get WARP+ as WireGuard written in python
Stars: ✭ 57 (+50%)
Mutual labels:  cloudflare
BlackIQ.ir
BlackIQ.ir Source Code
Stars: ✭ 14 (-63.16%)
Mutual labels:  cloudflare

A simple Cloudflare Worker with built-in routing

Here's a simple CloudFlare Worker with a built-in router that allows you to separate your worker logic into different functions and/or "controllers" so you can achieve a clean separation of concerns while working within the 1 script limit for non-Enterprise plans.

Sample route definitions:

router.get('/cloudflare', SampleController.index);
router.post('/cloudflare', SampleController.store);
router.get('/cloudflare/:id', SampleController.show);
router.put('/cloudflare/:id', SampleController.update);
router.delete('/cloudflare/:id', SampleController.destroy);
router.get('/cloudflare/routes/:id', (req) => {
    return response('Response from closure instead of controller: id=' + req.params.id);
});

Credits to Dave Willenberg and his Password pwnage CloudFlare Worker for the auto-deploy script and webpack config.


Quick Start

  1. Rename example.cloudflare.env to cloudflare.env and edit the values as needed.
  2. Update the index.js file with your routes, use function closures or separate controller files and go to town with a simple CloudFlare Worker with built-in routing!
  3. Install deps with npm install
  4. Launch 🚀 with npm run deploy

Try it live

Try out the following routes from the sample repo live here:

License

MIT

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].