Skip to content

Commit

Permalink
feat: add epic-content-stack URL
Browse files Browse the repository at this point in the history
  • Loading branch information
arpitdalal committed May 13, 2024
1 parent b18d664 commit f2a42f8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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");
Expand Down Expand Up @@ -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);
});
Expand Down
20 changes: 20 additions & 0 deletions tests/epic-content-stack.test.js
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"
);
});

0 comments on commit f2a42f8

Please sign in to comment.