mirror of
https://github.com/docmost/docmost.git
synced 2025-11-16 00:21:12 +10:00
refactor health module
This commit is contained in:
@ -16,7 +16,15 @@ export class TransformHttpResponseInterceptor<T>
|
||||
intercept(
|
||||
context: ExecutionContext,
|
||||
next: CallHandler<T>,
|
||||
): Observable<Response<T>> {
|
||||
): Observable<Response<T> | any> {
|
||||
const request = context.switchToHttp().getRequest();
|
||||
const path = request.url;
|
||||
|
||||
// Skip interceptor for the /api/health path
|
||||
if (path === '/api/health') {
|
||||
return next.handle();
|
||||
}
|
||||
|
||||
return next.handle().pipe(
|
||||
map((data) => {
|
||||
const status = context.switchToHttp().getResponse().statusCode;
|
||||
|
||||
Reference in New Issue
Block a user