feat(web): re-add open graph tags for public share links (#5635)

* feat: re-add open graph tags for public share links

* fix: undefined in html

* chore: tests
This commit is contained in:
Jason Rasmussen
2023-12-11 14:37:47 -05:00
committed by GitHub
parent ac2a36bd53
commit ed4358741e
12 changed files with 160 additions and 25 deletions

View File

@@ -13,7 +13,6 @@ import {
SwaggerDocumentOptions,
SwaggerModule,
} from '@nestjs/swagger';
import { NextFunction, Request, Response } from 'express';
import { writeFileSync } from 'fs';
import path from 'path';
@@ -101,14 +100,6 @@ const patchOpenAPI = (document: OpenAPIObject) => {
return document;
};
export const indexFallback = (excludePaths: string[]) => (req: Request, res: Response, next: NextFunction) => {
if (req.url.startsWith('/api') || req.method.toLowerCase() !== 'get' || excludePaths.indexOf(req.url) !== -1) {
next();
} else {
res.sendFile('/www/index.html', { root: process.cwd() });
}
};
export const useSwagger = (app: INestApplication, isDev: boolean) => {
const config = new DocumentBuilder()
.setTitle('Immich')