-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b18d664
commit f2a42f8
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,7 @@ const URLS = { | |
youtube: "https://youtube.com/@arpitdalal_dev/", | ||
mail: "mailto:[email protected]", | ||
xman: "https://xman.arpitdalal.dev/", | ||
"epic-content-stack": "https://github.com/arpitdalal/epic-content-stack", | ||
}; | ||
|
||
function blogHandler(req, res, pathToRemove) { | ||
|
@@ -83,6 +84,9 @@ function twitterHandler(res) { | |
function youtubeHandler(res) { | ||
res.redirect(URLS.youtube); | ||
} | ||
function epicContentStackHandler(res) { | ||
res.redirect(URLS["epic-content-stack"]); | ||
} | ||
|
||
app.get("/b/:path(*)?", (req, res) => { | ||
blogHandler(req, res, "/b"); | ||
|
@@ -119,6 +123,13 @@ app.get("/youtube/:path(*)?", (_, res) => { | |
youtubeHandler(res); | ||
}); | ||
|
||
app.get("/epc/:path(*)?", (_, res) => { | ||
epicContentStackHandler(res); | ||
}); | ||
app.get("/epic-content-stack/:path(*)?", (_, res) => { | ||
epicContentStackHandler(res); | ||
}); | ||
|
||
app.get("/email", (_, res) => { | ||
res.redirect(URLS.mail); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { test, expect } from "@playwright/test"; | ||
|
||
test('"/epic-content-stack" redirects to "github.com/arpitdalal/epic-content-stack" without utm params', async ({ | ||
page, | ||
}) => { | ||
await page.goto("/epic-content-stack"); | ||
|
||
await expect(page).toHaveURL( | ||
"https://github.com/arpitdalal/epic-content-stack" | ||
); | ||
}); | ||
test('"/epc" redirects to "github.com/arpitdalal/epic-content-stack" without utm params', async ({ | ||
page, | ||
}) => { | ||
await page.goto("/epc"); | ||
|
||
await expect(page).toHaveURL( | ||
"https://github.com/arpitdalal/epic-content-stack" | ||
); | ||
}); |