Giter Club home page Giter Club logo

url_shortener's Introduction

一个基于cloudflare pages/workers的URL短链接生成器

介绍

实现短链接的生成,采用了workers和pages分离的方式进行部署

因为是通过截取字符串的方式获取当前域名,所以只支持绑定普通的二级域名的主域名的方式进行部署,例如xxxx.xx,类似com.cn 结尾的域名不支持,并且不支持子域名

项目支持多个域名直接在cloudflare控制台绑定,无需修改代码

建议使用freenom的免费域名进行部署,很多四位短域名都可以正常注册。但因为freenom容易吞域名,所以项目建议绑定多个域名作为备选域名

部署方法

  1. Fork本项目
  2. 在Cloudflare Pages创建自己的项目
  3. 使用Fork的项目进行部署(根目录输入pages)
  4. 设置自定义的域名,将pages部署到url子域(url.xxxx.xx
  5. 在Cloudflare Workers创建自己的项目
  6. 复制workers/index.js的内容到复制自己的项目中
  7. 将其中的config根据需要填写
  8. 创建一个KV空间,并绑定到workers中,变量名称设置为KV
  9. 设置自定义的域名,将pages部署到主域(xxxx.xx
  10. 部署完成

演示站点

https://0135.cf/

https://0366.tk/

url_shortener's People

Contributors

wangwuxuan2011 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.