Skip to content

vabatta/cloudflare-redirector-worker

Repository files navigation

Welcome to cloudflare-redirector-worker 👋

Version Node.js CI Prerequisite Prerequisite Cloudflare worker XO code style License: CC--BY--ND--4.0

Simple redirector tool. Integrated with Storyblok.

Prerequisites

  • node 10.x
  • npm 6.x
  • @cloudflare/wrangler ^1.8

Install

You must have configured @cloudflare/wrangler before proceeding.

Install local dependencies.

npm install

Copy .env.example to a file for each environment you want to target (as described below) and fill it with the correct values.

Cloudflare environments

  • development
    • DOTENV_CONFIG_PATH=.env ENVIRONMENT=development NODE_ENV=development
  • staging
    • DOTENV_CONFIG_PATH=.env.staging ENVIRONMENT=staging NODE_ENV=production
  • production
    • DOTENV_CONFIG_PATH=.env.production ENVIRONMENT=production NODE_ENV=production

Usage

Start local development server

npm run start

Synchronize redirections.json with Storyblok space

npm run sync

Build the library NOTE: you may want to run sync before to sync the latest redirections

npm run build

Lint the code

npm run lint

Format the code

npm run format

Publishing

Publish the worker to Cloudflare to a target environment. Without target env, default is development.

npm run publish[:env]

Run tests

npm run test

Author

👤 vabatta

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 vabatta.

This project is Creative Commons Attribution No Derivatives 4.0 International licensed.


This README was generated with ❤️ by readme-md-generator

About

Simple redirector tool. Integrated with Storyblok.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published