kodadot / workers

Implementation of Cloudflare Workers in KodaDot
https://kodadot.xyz
10 stars 13 forks source link

Make url shortener #52

Open vikiival opened 1 year ago

vikiival commented 1 year ago

Based on Cloudflare KV worker we should be able to:

Ref:

Tech stack:

alko89 commented 1 year ago

https://github.com/kodadot/ops-internal/issues/287 throws 404 :)

vikiival commented 1 year ago

Which one?

image

alko89 commented 1 year ago

https://github.com/kodadot/ops-internal/issues/287 it seems to be an internal repo

vikiival commented 1 year ago

kodadot/ops-internal#287 it seems to be an internal repo

There is just some context but TL;DR

The output is simple

So to have full story:

there should be a POST call register that saves key: alko89 with value: <any https:// url>

when would then do <name-of-the-worker>/<key> it would redirect me to value.

Ideally having some sort of cache would be also good, so we save some reads (for ref you can check image or docs)

alko89 commented 1 year ago

I've done a basic implementation and while working on it I've come up with a few questions:

vikiival commented 1 year ago

Hey good questions.

  1. Only users with cloudflare API key should be authorized

  2. Same as one

  3. Since I wrote there handler for change, create throw err

alko89 commented 1 year ago

ok then, if I understand from the auth perspective I don't really have to do anything since it will work as an internal service right? :thinking:

Did the rust version, I noticed you added CORS rules in other projects, guess they should be present in all workers?