diff --git a/api-service/src/app.ts b/api-service/src/app.ts index 962331e9..6615ad74 100644 --- a/api-service/src/app.ts +++ b/api-service/src/app.ts @@ -22,7 +22,7 @@ app.use("/v2/", v2Router); app.use("/", druidProxyRouter); app.use("/alerts/v1", alertsRouter); app.use("/", metricRouter); -app.use("*", ResponseHandler.routeNotFound); +app.use(/(.*)/, ResponseHandler.routeNotFound); app.use(obsrvErrorHandler); app.listen(config.api_port, () => { diff --git a/api-service/src/routes/DruidProxyRouter.ts b/api-service/src/routes/DruidProxyRouter.ts index ca1aec91..fdf73315 100644 --- a/api-service/src/routes/DruidProxyRouter.ts +++ b/api-service/src/routes/DruidProxyRouter.ts @@ -9,15 +9,15 @@ import { ResponseHandler } from "../helpers/ResponseHandler"; export const druidProxyRouter = express.Router(); // Send a 410 Gone response to all V1 API calls -druidProxyRouter.all("/datasets/v1/*", ResponseHandler.goneResponse) -druidProxyRouter.all("/dataset/v1/*", ResponseHandler.goneResponse) -druidProxyRouter.all("/datasources/v1/*", ResponseHandler.goneResponse) -druidProxyRouter.all("/data/v1/*", ResponseHandler.goneResponse) -druidProxyRouter.all("/template/v1/*", ResponseHandler.goneResponse) +druidProxyRouter.all(/\/datasets\/v1(.*)/, ResponseHandler.goneResponse); +druidProxyRouter.all(/\/dataset\/v1(.*)/, ResponseHandler.goneResponse); +druidProxyRouter.all(/\/datasources\/v1(.*)/, ResponseHandler.goneResponse); +druidProxyRouter.all(/\/data\/v1(.*)/, ResponseHandler.goneResponse); +druidProxyRouter.all(/\/template\/v1(.*)/, ResponseHandler.goneResponse); // Druid Proxy APIs for Metabase integration -druidProxyRouter.post(/\/druid\/v2.*/, setDataToRequestObject("query.wrapper.native.post"), onRequest({ entity: Entity.DruidProxy }), wrapperService.forwardNative) -druidProxyRouter.get(/\/druid\/v2.*/, setDataToRequestObject("query.wrapper.native.get"), onRequest({ entity: Entity.DruidProxy }), wrapperService.forwardNativeGet) +druidProxyRouter.post(/\/druid\/v2(.*)/, setDataToRequestObject("query.wrapper.native.post"), onRequest({ entity: Entity.DruidProxy }), wrapperService.forwardNative); +druidProxyRouter.get(/\/druid\/v2(.*)/, setDataToRequestObject("query.wrapper.native.get"), onRequest({ entity: Entity.DruidProxy }), wrapperService.forwardNativeGet); druidProxyRouter.delete("/druid/v2/:queryId", setDataToRequestObject("query.wrapper.native.delete"), onRequest({ entity: Entity.DruidProxy }), wrapperService.forwardNativeDel) druidProxyRouter.get("/status", setDataToRequestObject("query.wrapper.status"), onRequest({ entity: Entity.DruidProxy }), wrapperService.nativeStatus) druidProxyRouter.get("/health", setDataToRequestObject("api.health"), onRequest({ entity: Entity.DruidProxy }), healthService.checkDruidHealth) \ No newline at end of file