Added rudementary page content
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Nicolai Ort 2021-09-25 17:44:34 +02:00
parent b64a8436e7
commit e1621b72ad
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
1 changed files with 12 additions and 7 deletions

View File

@ -112,7 +112,7 @@ fastify.get('/:shortcode', async (req, res) => {
return 404
}
if(isBot(req.headers['user-agent']) && target[0].no_preview){
if (isBot(req.headers['user-agent']) && target[0].no_preview) {
return `
<!DOCTYPE html>
<html lang="en">
@ -123,15 +123,20 @@ fastify.get('/:shortcode', async (req, res) => {
<meta property="og:title" content="LinkyLinky">
<meta property="og:site_name" content="LinkyLinky by Kauft.es">
<meta property="og:url" content="https://kauft.es/">
<meta property="og:description" content="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.
T">
<meta property="og:description" content="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.">
<meta property="og:type" content="article">
<meta property="og:image" content="https://kauft.es/dashboard/icon_128.png">
<title>LinkyLinky</title>
</head>
<body>
<p align="center">
<img height="150" src="https://kauft.es/dashboard/icon_128.png">
<h1 align="center">LinkyLinky 🔗</h1>
<h3 align="center">A small url shortener, originaly developed for kauft.es</h3>
<p>LinkyLinky by Kauft.es is a custom url shortener.<br>
You're reading this, b/c someone doesn't want their shorturl to be indexed by bots/crawlers/spiders.</p>
</p>
</body>
</html>
`;
@ -317,10 +322,10 @@ fastify.after(() => {
//Get all visits api route
fastify.get('/api/visits', { onRequest: fastify.auth([fastify.basicAuth, fastify.verifyJWT]) }, async (req, res) => {
if(req.query.provider){
if (req.query.provider) {
return await knex.select('shortcode', 'provider', 'timestamp')
.from('visits')
.where("provider", "=", req.query.provider);
.from('visits')
.where("provider", "=", req.query.provider);
}
return await knex.select('shortcode', 'provider', 'timestamp')
.from('visits');