Test the current network congestion of Cloudflare based on datacenter routing
Find a file
2019-05-30 16:24:38 -04:00
.github Update main.workflow 2019-04-17 23:25:32 -04:00
misc KV storage 2019-05-30 16:24:38 -04:00
public KV storage 2019-05-30 16:24:38 -04:00
src Update list of websites 2019-05-14 10:34:35 -04:00
.env.example KV storage 2019-05-30 16:24:38 -04:00
.gitignore KV storage 2019-05-30 16:24:38 -04:00
_redirects Create _redirects 2019-04-16 11:56:32 -04:00
babel.config.js Initial Work Commit 2019-04-14 00:25:19 -04:00
package-lock.json KV storage 2019-05-30 16:24:38 -04:00
package.json KV storage 2019-05-30 16:24:38 -04:00
README.md KV storage 2019-05-30 16:24:38 -04:00
serverless.yml KV storage 2019-05-30 16:24:38 -04:00
tsconfig.json KV storage 2019-05-30 16:24:38 -04:00

Netlify Status

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.

  1. copy .env.example to .env and fill in all of the relevant values (CLOUDFLARE_BEARER should be blank for now)
  2. run node_modules/.bin/cross-dotenv serverless deploy to deploy the worker script.

Publish flow

  1. build your files needed (npm run build)
  2. populate IATA codes (npm run populate)
  3. 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

Customize configuration

See Configuration Reference.