Skip to content

Commit

Permalink
Merge pull request #247 from Sanketika-Obsrv/1.1RC-fix
Browse files Browse the repository at this point in the history
#OBS-I222 : Resolved regexp route issue in express version 5
  • Loading branch information
HarishGangula authored Sep 16, 2024
2 parents 2c99d87 + 0ddb49e commit 8a87aea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, () => {
Expand Down
22 changes: 11 additions & 11 deletions api-service/src/routes/DruidProxyRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.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)
// 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.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)

0 comments on commit 8a87aea

Please sign in to comment.