Open-source IoT Platform - Device management, data collection, processing and visualization.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
499 B

// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
import type { ServerResponse } from 'node:http';
import type { Connect } from 'vite';
const tbHtmlFallbackMiddleware: Connect.NextHandleFunction = (
req: Connect.IncomingMessage,
_res: ServerResponse,
next: Connect.NextFunction
) => {
if (/^\/resources\/scada-symbols\/(?:system|tenant)\/[^/]+$/.test(req.url)) {
req.url = '/';
}
next();
}
export default tbHtmlFallbackMiddleware;