1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Stop indexing /about/peertube

This commit is contained in:
Chocobozzz 2021-10-08 11:06:02 +02:00
parent 32e06ca4de
commit 42cc1887af
No known key found for this signature in database
GPG key ID: 583A612D890159BE
5 changed files with 33 additions and 2 deletions

View file

@ -5,12 +5,12 @@ import { join } from 'path'
import { logger } from '@server/helpers/logger'
import { CONFIG } from '@server/initializers/config'
import { Hooks } from '@server/lib/plugins/hooks'
import { HttpStatusCode } from '@shared/models'
import { buildFileLocale, getCompleteLocale, is18nLocale, LOCALE_FILES } from '@shared/core-utils/i18n'
import { HttpStatusCode } from '@shared/models'
import { root } from '../helpers/core-utils'
import { STATIC_MAX_AGE } from '../initializers/constants'
import { ClientHtml, sendHTML, serveIndexHTML } from '../lib/client-html'
import { asyncMiddleware, embedCSP } from '../middlewares'
import { asyncMiddleware, disableRobots, embedCSP } from '../middlewares'
const clientsRouter = express.Router()
@ -81,6 +81,12 @@ clientsRouter.use('/client/*', (req: express.Request, res: express.Response) =>
res.status(HttpStatusCode.NOT_FOUND_404).end()
})
// No index exceptions
clientsRouter.all('/about/peertube',
disableRobots,
asyncMiddleware(serveIndexHTML)
)
// Always serve index client page (the client is a single page application, let it handle routing)
// Try to provide the right language index.html
clientsRouter.use('/(:language)?', asyncMiddleware(serveIndexHTML))