cloudflare / template-registry

A simple API via a Worker that serves all the template content
https://developers.cloudflare.com/workers/templates
Apache License 2.0
62 stars 37 forks source link

Basic http auth snippet #19

Closed maximivanov closed 4 years ago

maximivanov commented 4 years ago

Adding an example with Basic HTTP authentication as suggested by @victoriabernard92

Source PR: https://github.com/south-lane/cf-worker-basic-http-auth/pull/1

maximivanov commented 4 years ago

I may need to reorder things in code to follow the guideline. On it.

maximivanov commented 4 years ago

@victoriabernard92 toml file added. I was not sure about share_url as there's some difference in docs and in other snippets on how to define it. Some do not even have it so I guess it's no longer used.

Also reordered code blocks. Let me know if it works.

maximivanov commented 4 years ago

@victoriabernard92 anything else to fix in this PR?

exvuma commented 4 years ago

Thanks @maximivanov almost there let me know what you think of my suggestions then I think we can merge

maximivanov commented 4 years ago

Hey @victoriabernard92 thanks for the suggestions, they look great!

Not sure why the build is failing though. It seems like it can't find ./dist/index.js... does it look in project's root while dist folder is in workers-site/?

I git-rebased latest changes from the upstream repo's master to my branch but it didn't help.

exvuma commented 4 years ago

@maximivanov Builds are broken because CI isn't running the build step. Not this PR's fault I opened an issue because I've been meaning to fix this:https://github.com/ashleygwilliams/template-registry/issues/23

Sorry for the trouble there.

maximivanov commented 4 years ago

Hi @victoriabernard92 I just realized this snippet is not appearing on the templates site... not sure whether it's expected or if something is broken.