dashboardjavacloudcoapiotiot-analyticsiot-platformiot-solutionskafkalwm2mmicroservicesmiddlewaremqttnettyplatformsnmpthingsboardvisualizationwebsocketswidgets
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.
18 lines
542 B
18 lines
542 B
// SPDX-FileCopyrightText: Copyright The Thingsboard Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
import type { ServerResponse } from 'node:http';
|
|
import type { Connect } from 'vite';
|
|
import type { NextHandleFunction } from 'connect';
|
|
|
|
const tbHtmlFallbackMiddleware: NextHandleFunction = (
|
|
req: Connect.IncomingMessage,
|
|
_res: ServerResponse,
|
|
next: Connect.NextFunction
|
|
) => {
|
|
if (/^\/resources\/scada-symbols\/(?:system|tenant)\/[^/]+$/.test(req.url)) {
|
|
req.url = '/';
|
|
}
|
|
next();
|
|
}
|
|
|
|
export default tbHtmlFallbackMiddleware;
|
|
|