GithubHelp home page GithubHelp logo

xytom / url-shorten-worker Goto Github PK

View Code? Open in Web Editor NEW
1.5K 13.0 1.1K 910 KB

A URL Shortener created using Cloudflare worker

Home Page: https://lnks.eu.org

License: MIT License

JavaScript 100.00%
javascript url-shortener shorten-urls bitly shortener cloudflare-worker serverless tinyurl api cloudflare-workers

url-shorten-worker's Introduction

Url-Shorten-Worker

A URL Shortener created using Cloudflare Worker

API

API Documentation (API文档)

Getting start

去Workers KV中创建一个命名空间

Go to Workers KV and create a namespace.

去Worker的Settings选选项卡中绑定KV Namespace

Bind an instance of a KV Namespace to access its data in a Worker.

其中Variable name填写LINKS, KV namespace 选择你刚刚创建的命名空间

Where Variable name should set as LINKS and KV namespace is the namespace you just created in the first step.

复制本项目中的index.js的代码到Cloudflare Worker

Copy the index.js code from this project to Cloudflare Worker.

点击Save and Deploy

Click Save and Deploy

Demo

https://lnks.eu.org/

Note: Because someone abuse this demo website, all the generated link will automatically expired after 24 hours. For long-term use, please deploy your own.

注意:所有由Demo网站生成的链接24小时后会自动失效,如需长期使用请自行搭建。

crazypeace 修改版

https://github.com/xyTom/Url-Shorten-Worker/tree/crazypeace

支持功能:1、自定义短链 2、页面缓存设置过的短链 3、长链接文本框预搜索localStorage 4、增加删除某条短链的按钮 5、密码保护

url-shorten-worker's People

Contributors

0xflotus avatar a7t avatar cf-pages avatar cloudtom avatar dras51 avatar im-satyendra avatar shinyzhu avatar vanillapod-ze avatar xytom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

url-shorten-worker's Issues

请问短链能自定义吗?

谢谢dalao的付出,已经部署上了。

现在生成的是不规则的,希望生成可自定义的,这样我发给朋友时就不用检查短链是否正确了。
如名称有重复的,则最新覆盖旧的自定义名称。

自定义post短链接

我已经修改好Url-Shorten-Worker支持short menu

现在就差自定义路径了,我看之前可以查看KV命名空间自定义,这确实是一种方法,但是不够方便,手机操作不便携

希望作者有时间加入计划中,这样就非常完美了

  • 无需服务器
  • 支持short menu
  • 支持KV 命名空间自定义路径
  • 支持post自定义路径

[Request] Check URL before submit if exist

Hello,
I have a user who keeps abusing the site by submitting a specific URL multiple times each day.
How can I check the URL before submitting if it already exists or not, and simply showing an error message "URL has been submitted before. Check this URL: http://shorten.li/bHNv1P" ??

Thank you.

希望能提供自定义路径

如题,我发现你只是将路径作为key,网站作为value,我认为将自动随机生成key改为用户输入比较好,如果用户没有输入,那么再随机。

请教同学一个问题哈

我看同学的https://xytom.github.io/Url-Shorten-Worker/no-ref.html是指向https://github.com/xyTom/Url-Shorten-Worker/blob/gh-pages/no-ref.html的.
想问一下这个咋配置,我已经复制了所有的分枝.
感谢

lnks.tools: Error: Url illegal.

Hi.

I get "Error: Url illegal." error after submitting a link through your lnks.tools site and on my own deployed worker.

[URGENT] Disabling malicious redirect http://yuren.me/QnZYED

Hi Team

Please note that a phishing URL shortener registered through your service is being used to redirect to a phishing attack. It is available at the following URL:

http://yuren.me/QnZYED

Which will redirect to the following website:

https://accesspoint01.challengedrumstreet.ru/

Which is currently conducting a phishing attack against the users of this website:

https://vystarcu.org/

Please assist us with Disabling it as soon as possible, we appreciate your swift response in this regard. If you require any additional information, please do not hesitate to contact me at [email protected]

deleting links

how to delete links after 24 hours?
如何24小时后删啊

自定义不同域名

非常感谢您的项目,有个问题想请教

如果我现在有域名 myurl.com
如何实现 访问url.myurl.com为短连接主页,生成短连接格式 myurl.com/abcdef

例如 访问t.cn为微博主页,同时微博短连接为t.cn/abcdef

谢谢啦

KV SAVE ERROR

KV has been saved like this since a few days ago. Is this normal? I can't manage the domain
스크린샷 2024-01-18 012726

Feature

Custom alias feature please

自己部署的worker中,一天后短链无法访问

将index.js的内容复制到自己的cf worker空间中,配置了KV namespace,绑定了自己的域名。转成短链后,约1天内链接访问正常,KV里有记录可查;但是一天后短链无法跳转,KV记录被清空,期间我没有对自己部署的项目进行任何干涉。请问是哪里出了问题呢?

添加跨源资源共享(CORS)支持

在网站上尝试调用API时遇到的问题

Request header field Content-Type is not allowed by Access-Control-Allow-Headers.
XMLHttpRequest cannot load https://5it.me/ due to access control checks.
Failed to load resource: Request header field Content-Type is not allowed by Access-Control-Allow-Headers.

自己尝试修改js没成功,能否请dalao帮助解决

大佬可不可以加一个后台管理界面

这样子就不用在上cfkv里,就可以自定义和删除了
另,可不可以在两个地方加个可选的密码一个是跳转,另外一个是主界面,因为害怕被不法分子拿来利用

CF Error 1101 (CNAME on @)

Hello, I was just following the steps and this is a great script, though I can only route them as a sub-domain, though when I use the root domain, it results as "Worker threw exception"

Is there a fix for this?


Nevermind, I've fixed it...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.