Compare commits

..

No commits in common. "e1621b72ade1fce381f30bcf310a6dcf8d1c65ea" and "9d7125a31186f3b7f33df4875db12c67cf91f536" have entirely different histories.

2 changed files with 10 additions and 15 deletions

View File

@ -1,4 +1,4 @@
FROM registry.odit.services/hub/library/node:16.6.2-alpine3.14
FROM node:16.6.2-alpine3.14
WORKDIR /app
COPY package.json .
COPY yarn.lock .
@ -9,7 +9,7 @@ COPY knexfile.js ./
RUN mkdir db
#
# FROM astefanutti/scratch-node:16.0.0
FROM registry.odit.services/hub/library/node:16.6.2-alpine3.14
FROM node:16.6.2-alpine3.14
WORKDIR /app
COPY --from=0 /app /app
ENV NODE_ENV production

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,20 +123,15 @@ 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.">
<meta property="og:type" content="article">
<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:type" content="product">
<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>
`;
@ -322,10 +317,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');