aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/static.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r--server/controllers/static.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts
index 35e024dda..912d7e36c 100644
--- a/server/controllers/static.ts
+++ b/server/controllers/static.ts
@@ -3,7 +3,7 @@ import * as express from 'express'
3import { join } from 'path' 3import { join } from 'path'
4import { serveIndexHTML } from '@server/lib/client-html' 4import { serveIndexHTML } from '@server/lib/client-html'
5import { ServerConfigManager } from '@server/lib/server-config-manager' 5import { ServerConfigManager } from '@server/lib/server-config-manager'
6import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' 6import { HttpStatusCode } from '@shared/models'
7import { HttpNodeinfoDiasporaSoftwareNsSchema20 } from '../../shared/models/nodeinfo/nodeinfo.model' 7import { HttpNodeinfoDiasporaSoftwareNsSchema20 } from '../../shared/models/nodeinfo/nodeinfo.model'
8import { root } from '../helpers/core-utils' 8import { root } from '../helpers/core-utils'
9import { CONFIG, isEmailEnabled } from '../initializers/config' 9import { CONFIG, isEmailEnabled } from '../initializers/config'
@@ -19,7 +19,7 @@ import {
19} from '../initializers/constants' 19} from '../initializers/constants'
20import { getThemeOrDefault } from '../lib/plugins/theme-utils' 20import { getThemeOrDefault } from '../lib/plugins/theme-utils'
21import { asyncMiddleware } from '../middlewares' 21import { asyncMiddleware } from '../middlewares'
22import { cacheRoute } from '../middlewares/cache' 22import { cacheRoute } from '../middlewares/cache/cache'
23import { UserModel } from '../models/user/user' 23import { UserModel } from '../models/user/user'
24import { VideoModel } from '../models/video/video' 24import { VideoModel } from '../models/video/video'
25import { VideoCommentModel } from '../models/video/video-comment' 25import { VideoCommentModel } from '../models/video/video-comment'
@@ -66,7 +66,7 @@ staticRouter.use(
66 66
67// robots.txt service 67// robots.txt service
68staticRouter.get('/robots.txt', 68staticRouter.get('/robots.txt',
69 asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.ROBOTS)), 69 cacheRoute(ROUTE_CACHE_LIFETIME.ROBOTS),
70 (_, res: express.Response) => { 70 (_, res: express.Response) => {
71 res.type('text/plain') 71 res.type('text/plain')
72 return res.send(CONFIG.INSTANCE.ROBOTS) 72 return res.send(CONFIG.INSTANCE.ROBOTS)
@@ -86,7 +86,7 @@ staticRouter.get('/security.txt',
86) 86)
87 87
88staticRouter.get('/.well-known/security.txt', 88staticRouter.get('/.well-known/security.txt',
89 asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.SECURITYTXT)), 89 cacheRoute(ROUTE_CACHE_LIFETIME.SECURITYTXT),
90 (_, res: express.Response) => { 90 (_, res: express.Response) => {
91 res.type('text/plain') 91 res.type('text/plain')
92 return res.send(CONFIG.INSTANCE.SECURITYTXT + CONFIG.INSTANCE.SECURITYTXT_CONTACT) 92 return res.send(CONFIG.INSTANCE.SECURITYTXT + CONFIG.INSTANCE.SECURITYTXT_CONTACT)
@@ -95,7 +95,7 @@ staticRouter.get('/.well-known/security.txt',
95 95
96// nodeinfo service 96// nodeinfo service
97staticRouter.use('/.well-known/nodeinfo', 97staticRouter.use('/.well-known/nodeinfo',
98 asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.NODEINFO)), 98 cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO),
99 (_, res: express.Response) => { 99 (_, res: express.Response) => {
100 return res.json({ 100 return res.json({
101 links: [ 101 links: [
@@ -108,13 +108,13 @@ staticRouter.use('/.well-known/nodeinfo',
108 } 108 }
109) 109)
110staticRouter.use('/nodeinfo/:version.json', 110staticRouter.use('/nodeinfo/:version.json',
111 asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.NODEINFO)), 111 cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO),
112 asyncMiddleware(generateNodeinfo) 112 asyncMiddleware(generateNodeinfo)
113) 113)
114 114
115// dnt-policy.txt service (see https://www.eff.org/dnt-policy) 115// dnt-policy.txt service (see https://www.eff.org/dnt-policy)
116staticRouter.use('/.well-known/dnt-policy.txt', 116staticRouter.use('/.well-known/dnt-policy.txt',
117 asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.DNT_POLICY)), 117 cacheRoute(ROUTE_CACHE_LIFETIME.DNT_POLICY),
118 (_, res: express.Response) => { 118 (_, res: express.Response) => {
119 res.type('text/plain') 119 res.type('text/plain')
120 120