Skip to content

Commit

Permalink
#OBS-I165: merged latest code
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakshitha-D committed Sep 16, 2024
2 parents 904a526 + 8a87aea commit 2cdc2ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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
14 changes: 7 additions & 7 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.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 2cdc2ba

Please sign in to comment.