fix: target reg rule and docs

This commit is contained in:
oiov
2024-08-05 10:12:02 +08:00
parent 0a0ec79190
commit 74dc51c401
8 changed files with 32 additions and 10 deletions
+9 -1
View File
@@ -1,4 +1,12 @@
---
title: Zeabur Custom Domain
description: Free parsing of Zeabur custom domain names.
---
---
Follow these steps:
![](/_static/examples/zeabur_01.png)
![](/_static/examples/zeabur_02.png)
![](/_static/examples/zeabur_03.png)
+14
View File
@@ -13,3 +13,17 @@ description: Create and manage your short URLs.
2. **Input Long URL**: Paste or type the URL you want to shorten into the provided input box.
3. **Generate Short Link**: Click the "Generate" button, and the system will automatically create a short link for you.
4. **Copy and Use**: Click the "Copy" button to copy the short link to your clipboard, and you can use it wherever needed.
## URL Stats
- **Clicks**: The number of times the short link has been clicked.
- **Visitors**: The number of unique visitors who have visited the short link.
WR.DO provides a simple access statistics feature that can be used to track the click count and visitor count of the short link.
## Expiration
- **No Expiration**: The short link will never expire.
- **Expiration**: The short link will expire after the specified time.
Once the generated short chain becomes invalid, it will not be deleted. When accessing the short chain again, it will be redirected to this page. Users can reset the short chain validity period to activate.
+1 -1
View File
@@ -14,7 +14,7 @@ import * as z from "zod";
*/
const urlPattern = /^(?!-)[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*(?<!-)$/;
const targetPattern =
/^(https?:\/\/)([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(:\d+)?(\/[a-zA-Z0-9-]*)*(\/|\?([a-zA-Z0-9-]+=[a-zA-Z0-9-]*(&[a-zA-Z0-9-]+=[a-zA-Z0-9-]*)*)?)?$/;
/^(https?:\/\/)([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(:\d+)?(\/[a-zA-Z0-9-_.]*)*(\/|\?([a-zA-Z0-9-_.]+=[a-zA-Z0-9-_.]*(&[a-zA-Z0-9-_.]+=[a-zA-Z0-9-_.]*)*)?)?(\.[a-zA-Z]{2,6})?$/;
export const createUrlSchema = z.object({
id: z.string().optional(),
+2 -2
View File
@@ -12,7 +12,7 @@ export default auth(async (req) => {
try {
const ip = req.headers.get("X-Forwarded-For");
if (req.url.includes("/s/")) {
const match = req.url.match(/[^/]+$/);
const match = req.url.match(/([^/?]+)(?:\?.*)?$/);
if (match) {
const geo = geolocation(req);
@@ -32,7 +32,7 @@ export default auth(async (req) => {
"Content-Type": "application/json",
},
body: JSON.stringify({
slug: match[0],
slug: match[1],
referer,
ip,
city: geo?.city,
+6 -6
View File
@@ -39,12 +39,12 @@ const nextConfig = {
},
{
source: "/0",
destination: "https://www.oiov.dev",
destination: "https://wr.do/s/0",
permanent: true,
},
{
source: "/9",
destination: "https://f8dd841.webp.li/IMG20240703084254.jpg",
destination: "https://wr.do/s/9",
permanent: true,
},
{
@@ -59,22 +59,22 @@ const nextConfig = {
},
{
source: "/x",
destination: "https://x.com/yesmoree",
destination: "https://wr.do/s/x",
permanent: true,
},
{
source: "/solo",
destination: "https://solo.oiov.dev",
destination: "https://wr.do/s/solo",
permanent: true,
},
{
source: "/rmbg",
destination: "https://remover.wr.do",
destination: "https://wr.do/s/rmbg",
permanent: true,
},
{
source: "/llk",
destination: "https://www.oiov.dev/blog/llk",
destination: "https://wr.do/s/llk",
permanent: true,
},
];
Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB