diff --git a/src/server.js b/src/server.js
index 1891450..eb18644 100644
--- a/src/server.js
+++ b/src/server.js
@@ -113,33 +113,13 @@ fastify.get('/:shortcode', async (req, res) => {
}
if (isBot(req.headers['user-agent']) && target[0].no_preview) {
- return `
-
-
-
-
-
-
-
-
-
-
-
-
+ res.type("text/html");
+ return bot_html;
+ }
- LinkyLinky
-
-
-
-
-
LinkyLinky 🔗
- A small url shortener, originaly developed for kauft.es
- LinkyLinky by Kauft.es is a custom url shortener.
- You're reading this, b/c someone doesn't want their shorturl to be indexed by bots/crawlers/spiders.
-
-
-
- `;
+ if (target[0].clientside) {
+ res.type("text/html");
+ return clientside_html.replace("{{targeturl}}", target[0].target)
}
res.redirect(302, target[0].target);
@@ -479,6 +459,286 @@ async function validate(username, password, req, reply) {
req.user = username;
}
+const bot_html = `
+
+
+
+
+
+
+
+
+
+
+
+
+ LinkyLinky
+
+
+
+
+
LinkyLinky 🔗
+ A small url shortener, originaly developed for kauft.es
+ LinkyLinky by Kauft.es is a custom url shortener.
+ You're reading this, b/c someone doesn't want their shorturl to be indexed by bots/crawlers/spiders.
+
+
+
+ `;
+
+const clientside_html = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
kauft.es
+
+
+
kauft.es
+
+
+
kauft.es
+
+
+
kauft.es
+
+
+
kauft.es
+
+
+
kauft.es
+
+
+
+
+
+
+
+
+`;
+
// Run the server!
const start = async () => {
try {