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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user