mirror of
https://github.com/judge2020/cloudflare-connectivity-test.git
synced 2026-04-28 03:20:12 +00:00
Test the current network congestion of Cloudflare based on datacenter routing
| .github | ||
| misc | ||
| public | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| _redirects | ||
| babel.config.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| serverless.yml | ||
| tsconfig.json | ||
cloudflare connectivity test (worker)
Cloudflare connection test (unofficial). This is meant to be a Cloudflare-hosted setup by storing files in workers KV.
This is a concept. I do not plan to make this a maintained library or solution to hosting things on Cloudflare long-term.
Setup
(npm install first)
Note: in order to get IATA code lookups working, you will need a IATAcodes.org API key. You can populate this at build time with npm run populate and the API key set to the variable IATA_KEY.
- copy .env.example to .env and fill in all of the relevant values (
CLOUDFLARE_BEARERshould be blank for now) - run
node_modules/.bin/cross-dotenv serverless deployto deploy the worker script.
Publish flow
- build your files needed (
npm run build) - populate IATA codes (
npm run populate) - upload to the KV namespace (
npm run upload)
Limitations
- maximum file size is 2mb (after base64 encoding)
- may not handle edge cases
Potential improvements:
- cache API (or global variables) for the pulled files
- storing bigger files by splitting the encoded string into multiple K/V variables.
Project setup
npm install
Compiles and hot-reloads for development
npm run serve
Compiles and minifies for production
npm run build
Run your tests
npm run test
Lints and fixes files
npm run lint