# shortlink **Repository Path**: heipiao/shortlink ## Basic Information - **Project Name**: shortlink - **Description**: 利用 cloudfare 设置短链 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-05-15 - **Last Updated**: 2024-06-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ![](images/index.png) ## 使用方法 ``` npm install -g @cloudflare/wrangler wrangler login ``` 修改index.js中的路径为你自己的路径,防止其他人使用,如果需要公开访问,把`admin_path`设置成`/`即可 ```js const admin_path = '/short_link_admin' const api_path = '/short_api' ``` 去cf worker页面创建一个kv,并且把id填写到`wrangler.toml`里面,在进行发布,并把`wrangler.toml`中的`account_id`改成你自己的(通过`wrangler whoami`查看) ``` wrangler publish ``` 原始项目:https://github.com/code-scan/cfwork_shortlink_text 此篇仅作学习备份,防 github 失联