Bookmark App with Cloudflare Workers.
You can deploy your own Marks to the Cloudflare Workers.
Add Bookmark from shortcuts of macOS:
- Cloudflare Account
- Wrangler
$ git clone https://github.com/yusukebe/marks.git
$ cd marks
$ yarn install
Rename wrangler.toml
:
$ mv wrangler.example.toml wrangler.toml
Make KV namespace id:
$ wrangler kv:namespace create BOOKMARK
🌀 Creating namespace with title "marks-BOOKMARK"
✨ Success!
Add the following to your configuration file in your kv_namespaces array:
{ binding = "BOOKMARK", id = "your id" }
Edit wrangler.toml
:
kv_namespaces = [
{ binding = "BOOKMARK", id = "your id" }
]
Set your Basic Auth username and password:
$ wrangler secret put NAME
$ wrangler secret put PASS
$ wrangler publish
javascript: (function () {
var url = document.location.href
var links = document.getElementsByTagName('link')
for (i in links) {
if (links[i].rel) {
if (links[i].rel.toLowerCase() == 'canonical') {
url = links[i].href
}
}
}
var redirect =
'https://{app-name}.{your-name}.workers.dev/?url=' + encodeURIComponent(url)
location.href = redirect
})()
Yusuke Wada https://github.com/yusukebe
MIT