updates and fixes

* seo friendly urls
* custom client serve-static module
* database fixes
* fix recent pages
* other fixes
This commit is contained in:
Philipinho
2024-05-18 03:19:42 +01:00
parent eefe63d1cd
commit 9c7c2f1163
102 changed files with 921 additions and 536 deletions

View File

@ -4,7 +4,7 @@ import {
FastifyAdapter,
NestFastifyApplication,
} from '@nestjs/platform-fastify';
import { ValidationPipe } from '@nestjs/common';
import { NotFoundException, ValidationPipe } from '@nestjs/common';
import { TransformHttpResponseInterceptor } from './interceptors/http-response.interceptor';
import fastifyMultipart from '@fastify/multipart';
@ -14,12 +14,29 @@ async function bootstrap() {
new FastifyAdapter({
ignoreTrailingSlash: true,
ignoreDuplicateSlashes: true,
} as any),
}),
);
app.setGlobalPrefix('api');
await app.register(fastifyMultipart as any);
await app.register(fastifyMultipart);
app
.getHttpAdapter()
.getInstance()
.addHook('preHandler', function (req, reply, done) {
if (
req.originalUrl.startsWith('/api') &&
!req.originalUrl.startsWith('/api/auth/setup')
) {
if (!req.raw?.['workspaceId']) {
throw new NotFoundException('Workspace not found');
}
done();
} else {
done();
}
});
app.useGlobalPipes(
new ValidationPipe({