vabatta / cloudflare-redirector-worker

Simple redirector tool. Integrated with Storyblok.
Other
1 stars 0 forks source link

Clarify documentation #1

Closed Radiergummi closed 11 months ago

Radiergummi commented 1 year ago

What does this project actually do? The Readme doesn't disclose much. It sounds a bit like what I need, but I'm not sure.
Maybe you could add a short introduction to the Readme? 🙂

vabatta commented 1 year ago

This project uses the https://github.com/vabatta/cloudflare-redirector-worker/blob/master/utils/synchronize.js file to synchronise a Storyblok story with a list of redirections components as described in https://github.com/vabatta/cloudflare-redirector-worker/blob/master/src/types.d.ts#L1 to package them in a javascript worker to have redirections directly on a host level in Cloudflare.

You can read about the specs and behaviour in https://github.com/vabatta/cloudflare-redirector-worker/blob/master/features/handler.feature and the other feature for a detail description with use cases.

Radiergummi commented 11 months ago

I don't know if this is useful to you, but I'll leave it here just in case.
I solved it a bit differently and chose to generate a _redirects file during the Vite build phase:

https://github.com/feinschliff-studio/website/blob/develop/src/build/vite-plugin-storyblok-redirects.mts

It pulls redirect rules from a data source, with the status code added as an optional dimension.

Thank you for the inspiration though, closing this issue 🙂