Add simple count of views to share links (#4036)

* Add simple count of views to share links

* Remove no longer applicable tests

* Avoid incrementing view count for known bots
This commit is contained in:
Tom Moor
2022-08-31 08:16:40 +02:00
committed by GitHub
parent 212985e18f
commit 32b76303e5
9 changed files with 61 additions and 17 deletions

View File

@@ -1,8 +1,9 @@
import path from "path";
import Koa from "koa";
import Koa, { BaseContext } from "koa";
import Router from "koa-router";
import send from "koa-send";
import serve from "koa-static";
import userAgent, { UserAgentContext } from "koa-useragent";
import { languages } from "@shared/i18n";
import env from "@server/env";
import { NotFoundError } from "@server/errors";
@@ -22,6 +23,8 @@ koa.use(
})
);
koa.use<BaseContext, UserAgentContext>(userAgent);
if (isProduction) {
router.get("/static/*", async (ctx) => {
try {